
<!DOCTYPE html>

<html>
  
<!-- Mirrored from docs.sympy.org/latest/modules/polys/agca.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 15 Jan 2022 03:28:59 GMT -->
<!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=utf-8" /><!-- /Added by HTTrack -->
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

    <title>AGCA - Algebraic Geometry and Commutative Algebra Module &#8212; SymPy 1.9 documentation</title>
    <link rel="stylesheet" type="text/css" href="../../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../../_static/default.css" />
    <link rel="stylesheet" type="text/css" href="../../_static/graphviz.css" />
    <link rel="stylesheet" type="text/css" href="../../_static/plot_directive.css" />
    <link rel="stylesheet" type="text/css" href="../../../../live.sympy.org/static/live-core.css" />
    <link rel="stylesheet" type="text/css" href="../../../../live.sympy.org/static/live-autocomplete.css" />
    <link rel="stylesheet" type="text/css" href="../../../../live.sympy.org/static/live-sphinx.css" />
    
    <script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js"></script>
    <script src="../../_static/jquery.js"></script>
    <script src="../../_static/underscore.js"></script>
    <script src="../../_static/doctools.js"></script>
    <script src="../../../../live.sympy.org/static/utilities.js"></script>
    <script src="../../../../live.sympy.org/static/external/classy.js"></script>
    <script src="../../../../live.sympy.org/static/live-core.js"></script>
    <script src="../../../../live.sympy.org/static/live-autocomplete.js"></script>
    <script src="../../../../live.sympy.org/static/live-sphinx.js"></script>
    <script async="async" src="../../../../cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest8331.js?config=TeX-AMS_HTML-full"></script>
    <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["\\(", "\\)"]], "displayMath": [["\\[", "\\]"]]}})</script>
    
    <link rel="shortcut icon" href="../../_static/sympy-notailtext-favicon.ico"/>
    <link href="agca.html" rel="canonical" />
    
    <link rel="index" title="Index" href="../../genindex.html" />
    <link rel="search" title="Search" href="../../search.html" />
    <link rel="next" title="Introducing the Domains of the poly module" href="domainsintro.html" />
    <link rel="prev" title="Polynomials Manipulation Module Reference" href="reference.html" /> 
  </head><body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="domainsintro.html" title="Introducing the Domains of the poly module"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="reference.html" title="Polynomials Manipulation Module Reference"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../../index.html">SymPy 1.9 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../index.html" >SymPy Modules Reference</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="index.html" accesskey="U">Polynomial Manipulation</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="#">AGCA - Algebraic Geometry and Commutative Algebra Module</a></li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <section id="agca-algebraic-geometry-and-commutative-algebra-module">
<span id="polys-agca"></span><h1>AGCA - Algebraic Geometry and Commutative Algebra Module<a class="headerlink" href="#agca-algebraic-geometry-and-commutative-algebra-module" title="Permalink to this headline">¶</a></h1>
<section id="introduction">
<h2>Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h2>
<blockquote>
<div><p>Algebraic geometry is a mixture of the ideas of two Mediterranean
cultures. It is the superposition of the Arab science of the lightening
calculation of the solutions of equations over the Greek art of position
and shape.
This tapestry was originally woven on European soil and is still being refined
under the influence of international fashion. Algebraic geometry studies the
delicate balance between the geometrically plausible and the algebraically
possible.  Whenever one side of this mathematical teeter-totter outweighs the
other, one immediately loses interest and runs off in search of a more exciting
amusement.</p>
<blockquote>
<div><p>George R. Kempf
1944 – 2002</p>
</div></blockquote>
</div></blockquote>
<p>Algebraic Geometry refers to the study of geometric problems via algebraic
methods (and sometimes vice versa). While this is a rather old topic,
algebraic geometry as understood today is very much a 20th century
development. Building on ideas of e.g. Riemann and Dedekind, it was realized
that there is an intimate connection between properties of the set of
solutions of a system of polynomial equations (called an algebraic variety)
and the behavior of the set of polynomial functions on that variety
(called the coordinate ring).</p>
<p>As in many geometric disciplines, we can distinguish between local and global
questions (and methods). Local investigations in algebraic geometry are
essentially equivalent to the study of certain rings, their ideals and modules.
This latter topic is also called commutative algebra. It is the basic local
toolset of algebraic geometers, in much the same way that differential analysis
is the local toolset of differential geometers.</p>
<p>A good conceptual introduction to commutative algebra is <a class="reference internal" href="literature.html#atiyah69" id="id1"><span>[Atiyah69]</span></a>. An
introduction more geared towards computations, and the work most of the
algorithms in this module are based on, is <a class="reference internal" href="literature.html#greuel2008" id="id2"><span>[Greuel2008]</span></a>.</p>
<p>This module aims to eventually allow expression and solution of both
local and global geometric problems, both in the classical case over a field
and in the more modern arithmetic cases. So far, however, there is no geometric
functionality at all. Currently the module only provides tools for computational
commutative algebra over fields.</p>
<p>All code examples assume:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="o">*</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">z</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;x,y,z&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">init_printing</span><span class="p">(</span><span class="n">use_unicode</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">wrap_line</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
</pre></div>
</div>
</section>
<section id="reference">
<h2>Reference<a class="headerlink" href="#reference" title="Permalink to this headline">¶</a></h2>
<p>In this section we document the usage of the AGCA module. For convenience of
the reader, some definitions and examples/explanations are interspersed.</p>
<section id="base-rings">
<h3>Base Rings<a class="headerlink" href="#base-rings" title="Permalink to this headline">¶</a></h3>
<p>Almost all computations in commutative algebra are relative to a “base ring”.
(For example, when asking questions about an ideal, the base ring is the ring
the ideal is a subset of.) In principle all polys “domains” can be used as base
rings. However, useful functionality is only implemented for polynomial rings
over fields, and various localizations and quotients thereof.</p>
<p>As demonstrated in
the examples below, the most convenient method to create objects you are
interested in is to build them up from the ground field, and then use the
various methods to create new objects from old. For example, in order to
create the local ring of the nodal cubic <span class="math notranslate nohighlight">\(y^2 = x^3\)</span> at the origin, over
<span class="math notranslate nohighlight">\(\mathbb{Q}\)</span>, you do:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">lr</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">order</span><span class="o">=</span><span class="s2">&quot;ilex&quot;</span><span class="p">)</span> <span class="o">/</span> <span class="p">[</span><span class="n">y</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="n">x</span><span class="o">**</span><span class="mi">3</span><span class="p">]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">lr</span>
<span class="go">ℚ[x, y, order=ilex]</span>
<span class="go">───────────────────</span>
<span class="go">    ╱   3    2╲</span>
<span class="go">    ╲- x  + y ╱</span>
</pre></div>
</div>
<p>Note how the python list notation can be used as a short cut to express ideals.
You can use the <code class="docutils literal notranslate"><span class="pre">convert</span></code> method to return ordinary sympy objects into
objects understood by the AGCA module (although in many cases this will be done
automatically – for example the list was automatically turned into an ideal,
and in the process the symbols <span class="math notranslate nohighlight">\(x\)</span> and <span class="math notranslate nohighlight">\(y\)</span> were automatically converted into
other representations). For example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">X</span><span class="p">,</span> <span class="n">Y</span> <span class="o">=</span> <span class="n">lr</span><span class="o">.</span><span class="n">convert</span><span class="p">(</span><span class="n">x</span><span class="p">),</span> <span class="n">lr</span><span class="o">.</span><span class="n">convert</span><span class="p">(</span><span class="n">y</span><span class="p">)</span> <span class="p">;</span> <span class="n">X</span>
<span class="go">    ╱   3    2╲</span>
<span class="go">x + ╲- x  + y ╱</span>

<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">**</span><span class="mi">3</span> <span class="o">==</span> <span class="n">y</span><span class="o">**</span><span class="mi">2</span>
<span class="go">False</span>

<span class="gp">&gt;&gt;&gt; </span><span class="n">X</span><span class="o">**</span><span class="mi">3</span> <span class="o">==</span> <span class="n">Y</span><span class="o">**</span><span class="mi">2</span>
<span class="go">True</span>
</pre></div>
</div>
<p>When no localisation is needed, a more mathematical notation can be
used. For example, let us create the coordinate ring of three-dimensional
affine space <span class="math notranslate nohighlight">\(\mathbb{A}^3\)</span>:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">ar</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">z</span><span class="p">);</span> <span class="n">ar</span>
<span class="go">ℚ[x, y, z]</span>
</pre></div>
</div>
<p>For more details, refer to the following class documentation. Note that
the base rings, being domains, are the main point of overlap between the
AGCA module and the rest of the polys module. All domains are documented
in detail in the polys reference, so we show here only an abridged version,
with the methods most pertinent to the AGCA module.</p>
<dl class="py class">
<dt class="sig sig-object py">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.domains.ring.</span></span><span class="sig-name descname"><span class="pre">Ring</span></span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/ring.py#L9-L118"><span class="viewcode-link"><span class="pre">[source]</span></span></a></dt>
<dd><p>Represents a ring domain.</p>
<dl class="py method">
<dt class="sig sig-object py">
<span class="sig-name descname"><span class="pre">free_module</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">rank</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/ring.py#L69-L78"><span class="viewcode-link"><span class="pre">[source]</span></span></a></dt>
<dd><p>Generate a free module of rank <code class="docutils literal notranslate"><span class="pre">rank</span></code> over self.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="go">QQ[x]**2</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py">
<span class="sig-name descname"><span class="pre">ideal</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">gens</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/ring.py#L80-L91"><span class="viewcode-link"><span class="pre">[source]</span></span></a></dt>
<dd><p>Generate an ideal of <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">ideal</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">)</span>
<span class="go">&lt;x**2&gt;</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py">
<span class="sig-name descname"><span class="pre">quotient_ring</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">e</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/ring.py#L93-L115"><span class="viewcode-link"><span class="pre">[source]</span></span></a></dt>
<dd><p>Form a quotient ring of <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
<p>Here <code class="docutils literal notranslate"><span class="pre">e</span></code> can be an ideal or an iterable.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">quotient_ring</span><span class="p">(</span><span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">ideal</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">))</span>
<span class="go">QQ[x]/&lt;x**2&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">quotient_ring</span><span class="p">([</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">])</span>
<span class="go">QQ[x]/&lt;x**2&gt;</span>
</pre></div>
</div>
<p>The division operator has been overloaded for this:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">/</span><span class="p">[</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">]</span>
<span class="go">QQ[x]/&lt;x**2&gt;</span>
</pre></div>
</div>
</dd></dl>

</dd></dl>

<dl class="py function">
<dt class="sig sig-object py">
<span class="sig-prename descclassname"><span class="pre">sympy.polys.domains.polynomialring.</span></span><span class="sig-name descname"><span class="pre">PolynomialRing</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">domain_or_ring</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">symbols</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">order</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/polynomialring.py#L10-L199"><span class="viewcode-link"><span class="pre">[source]</span></span></a></dt>
<dd><p>A class for representing multivariate polynomial rings.</p>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.domains.quotientring.</span></span><span class="sig-name descname"><span class="pre">QuotientRing</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">ring</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ideal</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/domains/quotientring.py#L92-L201"><span class="viewcode-link"><span class="pre">[source]</span></span></a></dt>
<dd><p>Class representing (commutative) quotient rings.</p>
<p>You should not usually instantiate this by hand, instead use the constructor
from the base ring in the construction.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">I</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">ideal</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">3</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">quotient_ring</span><span class="p">(</span><span class="n">I</span><span class="p">)</span>
<span class="go">QQ[x]/&lt;x**3 + 1&gt;</span>
</pre></div>
</div>
<p>Shorter versions are possible:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">/</span><span class="n">I</span>
<span class="go">QQ[x]/&lt;x**3 + 1&gt;</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">/</span><span class="p">[</span><span class="n">x</span><span class="o">**</span><span class="mi">3</span> <span class="o">+</span> <span class="mi">1</span><span class="p">]</span>
<span class="go">QQ[x]/&lt;x**3 + 1&gt;</span>
</pre></div>
</div>
<p>Attributes:</p>
<ul class="simple">
<li><p>ring - the base ring</p></li>
<li><p>base_ideal - the ideal used to form the quotient</p></li>
</ul>
</dd></dl>

</section>
<section id="modules-ideals-and-their-elementary-properties">
<h3>Modules, Ideals and their Elementary Properties<a class="headerlink" href="#modules-ideals-and-their-elementary-properties" title="Permalink to this headline">¶</a></h3>
<p>Let <span class="math notranslate nohighlight">\(A\)</span> be a ring. An <span class="math notranslate nohighlight">\(A\)</span>-module is a set <span class="math notranslate nohighlight">\(M\)</span>, together with two binary
operations <span class="math notranslate nohighlight">\(+: M \times M \to M\)</span> and <span class="math notranslate nohighlight">\(\times: R \times M \to M\)</span> called
addition and scalar multiplication. These are required to satisfy certain
axioms, which can be found in e.g. <a class="reference internal" href="literature.html#atiyah69" id="id3"><span>[Atiyah69]</span></a>. In this way modules are
a direct generalisation of both vector spaces (<span class="math notranslate nohighlight">\(A\)</span> being a field) and abelian
groups (<span class="math notranslate nohighlight">\(A = \mathbb{Z}\)</span>). A <em>submodule</em> of the <span class="math notranslate nohighlight">\(A\)</span>-module <span class="math notranslate nohighlight">\(M\)</span> is a subset
<span class="math notranslate nohighlight">\(N \subset M\)</span>, such that the binary operations restrict to <span class="math notranslate nohighlight">\(N\)</span>, and <span class="math notranslate nohighlight">\(N\)</span> becomes
an <span class="math notranslate nohighlight">\(A\)</span>-module with these operations.</p>
<p>The ring <span class="math notranslate nohighlight">\(A\)</span> itself has a natural <span class="math notranslate nohighlight">\(A\)</span>-module structure where addition and
multiplication in the module coincide with addition and multiplication in
the ring. This <span class="math notranslate nohighlight">\(A\)</span>-module is also written as <span class="math notranslate nohighlight">\(A\)</span>. An <span class="math notranslate nohighlight">\(A\)</span>-submodule of <span class="math notranslate nohighlight">\(A\)</span>
is called an <em>ideal</em> of <span class="math notranslate nohighlight">\(A\)</span>. Ideals come up very naturally in algebraic
geometry. More general modules can be seen as a technically convenient “elbow
room” beyond talking only about ideals.</p>
<p>If <span class="math notranslate nohighlight">\(M\)</span>, <span class="math notranslate nohighlight">\(N\)</span> are <span class="math notranslate nohighlight">\(A\)</span>-modules,
then there is a natural (componentwise) <span class="math notranslate nohighlight">\(A\)</span>-module structure on <span class="math notranslate nohighlight">\(M \times N\)</span>.
Similarly there are <span class="math notranslate nohighlight">\(A\)</span>-module structures on cartesian products of more
components. (For the categorically inclined:
the cartesian product of finitely many <span class="math notranslate nohighlight">\(A\)</span>-modules, with this
<span class="math notranslate nohighlight">\(A\)</span>-module structure, is the finite biproduct in the category of all
<span class="math notranslate nohighlight">\(A\)</span>-modules. With infinitely many components, it is the direct product
(but the infinite direct sum has to be constructed differently).) As usual,
repeated product of the <span class="math notranslate nohighlight">\(A\)</span>-module <span class="math notranslate nohighlight">\(M\)</span> is denoted <span class="math notranslate nohighlight">\(M, M^2, M^3 \ldots\)</span>, or
<span class="math notranslate nohighlight">\(M^I\)</span> for arbitrary index sets <span class="math notranslate nohighlight">\(I\)</span>.</p>
<p>An <span class="math notranslate nohighlight">\(A\)</span>-module <span class="math notranslate nohighlight">\(M\)</span> is called <em>free</em> if it is isomorphic to the <span class="math notranslate nohighlight">\(A\)</span>-module
<span class="math notranslate nohighlight">\(A^I\)</span> for some (not necessarily finite) index set <span class="math notranslate nohighlight">\(I\)</span> (refer to the next
section for a definition of isomorphism). The cardinality of <span class="math notranslate nohighlight">\(I\)</span> is called
the <em>rank</em> of <span class="math notranslate nohighlight">\(M\)</span>; one may prove this is well-defined.
In general, the AGCA module only works with free modules of finite rank, and
other closely related modules. The easiest way to create modules is to use
member methods of the objects they are made up from. For example, let us create
a free module of rank 4 over the coordinate ring of <span class="math notranslate nohighlight">\(\mathbb{A}^2\)</span>
we created above, together with a submodule:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">F</span> <span class="o">=</span> <span class="n">ar</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">4</span><span class="p">)</span> <span class="p">;</span> <span class="n">F</span>
<span class="go">          4</span>
<span class="go">ℚ[x, y, z]</span>

<span class="gp">&gt;&gt;&gt; </span><span class="n">S</span> <span class="o">=</span> <span class="n">F</span><span class="o">.</span><span class="n">submodule</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="n">x</span><span class="o">**</span><span class="mi">3</span><span class="p">],</span> <span class="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">y</span><span class="p">])</span> <span class="p">;</span> <span class="n">S</span>
<span class="go">╱⎡       2   3⎤              ╲</span>
<span class="go">╲⎣1, x, x , x ⎦, [0, 1, 0, y]╱</span>
</pre></div>
</div>
<p>Note how python lists can be used as a short-cut notation for module
elements (vectors). As usual, the <code class="docutils literal notranslate"><span class="pre">convert</span></code> method can be used to convert
sympy/python objects into the internal AGCA representation (see detailed
reference below).</p>
<p>Here is the detailed documentation of the classes for modules, free modules,
and submodules:</p>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.Module">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.agca.modules.</span></span><span class="sig-name descname"><span class="pre">Module</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">ring</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L43-L156"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.Module" title="Permalink to this definition">¶</a></dt>
<dd><p>Abstract base class for modules.</p>
<p>Do not instantiate - use ring explicit constructors instead:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="go">QQ[x]**2</span>
</pre></div>
</div>
<p>Attributes:</p>
<ul class="simple">
<li><p>dtype - type of elements</p></li>
<li><p>ring - containing ring</p></li>
</ul>
<p>Non-implemented methods:</p>
<ul class="simple">
<li><p>submodule</p></li>
<li><p>quotient_module</p></li>
<li><p>is_zero</p></li>
<li><p>is_submodule</p></li>
<li><p>multiply_ideal</p></li>
</ul>
<p>The method convert likely needs to be changed in subclasses.</p>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.Module.contains">
<span class="sig-name descname"><span class="pre">contains</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">elem</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L96-L102"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.Module.contains" title="Permalink to this definition">¶</a></dt>
<dd><p>Return True if <code class="docutils literal notranslate"><span class="pre">elem</span></code> is an element of this module.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.Module.convert">
<span class="sig-name descname"><span class="pre">convert</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">elem</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">M</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L73-L81"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.Module.convert" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert <code class="docutils literal notranslate"><span class="pre">elem</span></code> into internal representation of this module.</p>
<p>If <code class="docutils literal notranslate"><span class="pre">M</span></code> is not None, it should be a module containing it.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.Module.identity_hom">
<span class="sig-name descname"><span class="pre">identity_hom</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L154-L156"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.Module.identity_hom" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the identity homomorphism on <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.Module.is_submodule">
<span class="sig-name descname"><span class="pre">is_submodule</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">other</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L134-L136"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.Module.is_submodule" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if <code class="docutils literal notranslate"><span class="pre">other</span></code> is a submodule of <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.Module.is_zero">
<span class="sig-name descname"><span class="pre">is_zero</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L130-L132"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.Module.is_zero" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if <code class="docutils literal notranslate"><span class="pre">self</span></code> is a zero module.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.Module.multiply_ideal">
<span class="sig-name descname"><span class="pre">multiply_ideal</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">other</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L138-L142"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.Module.multiply_ideal" title="Permalink to this definition">¶</a></dt>
<dd><p>Multiply <code class="docutils literal notranslate"><span class="pre">self</span></code> by the ideal <code class="docutils literal notranslate"><span class="pre">other</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.Module.quotient_module">
<span class="sig-name descname"><span class="pre">quotient_module</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">other</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L87-L89"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.Module.quotient_module" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate a quotient module.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.Module.submodule">
<span class="sig-name descname"><span class="pre">submodule</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">gens</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L83-L85"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.Module.submodule" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate a submodule.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.Module.subset">
<span class="sig-name descname"><span class="pre">subset</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">other</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L107-L122"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.Module.subset" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if <code class="docutils literal notranslate"><span class="pre">other</span></code> is is a subset of <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F</span><span class="o">.</span><span class="n">subset</span><span class="p">([(</span><span class="mi">1</span><span class="p">,</span> <span class="n">x</span><span class="p">),</span> <span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">2</span><span class="p">)])</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F</span><span class="o">.</span><span class="n">subset</span><span class="p">([(</span><span class="mi">1</span><span class="o">/</span><span class="n">x</span><span class="p">,</span> <span class="n">x</span><span class="p">),</span> <span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">2</span><span class="p">)])</span>
<span class="go">False</span>
</pre></div>
</div>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.FreeModule">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.agca.modules.</span></span><span class="sig-name descname"><span class="pre">FreeModule</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">ring</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">rank</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L282-L447"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.FreeModule" title="Permalink to this definition">¶</a></dt>
<dd><p>Abstract base class for free modules.</p>
<p>Additional attributes:</p>
<ul class="simple">
<li><p>rank - rank of the free module</p></li>
</ul>
<p>Non-implemented methods:</p>
<ul class="simple">
<li><p>submodule</p></li>
</ul>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.FreeModule.basis">
<span class="sig-name descname"><span class="pre">basis</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L380-L394"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.FreeModule.basis" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a set of basis elements.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">3</span><span class="p">)</span><span class="o">.</span><span class="n">basis</span><span class="p">()</span>
<span class="go">([1, 0, 0], [0, 1, 0], [0, 0, 1])</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.FreeModule.convert">
<span class="sig-name descname"><span class="pre">convert</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">elem</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">M</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L328-L359"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.FreeModule.convert" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert <code class="docutils literal notranslate"><span class="pre">elem</span></code> into the internal representation.</p>
<p>This method is called implicitly whenever computations involve elements
not in the internal representation.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F</span><span class="o">.</span><span class="n">convert</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">])</span>
<span class="go">[1, 0]</span>
</pre></div>
</div>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.FreeModule.dtype">
<span class="sig-name descname"><span class="pre">dtype</span></span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L259-L279"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.FreeModule.dtype" title="Permalink to this definition">¶</a></dt>
<dd><p>alias of <a class="reference internal" href="#sympy.polys.agca.modules.FreeModuleElement" title="sympy.polys.agca.modules.FreeModuleElement"><code class="xref py py-class docutils literal notranslate"><span class="pre">sympy.polys.agca.modules.FreeModuleElement</span></code></a></p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.FreeModule.identity_hom">
<span class="sig-name descname"><span class="pre">identity_hom</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L432-L447"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.FreeModule.identity_hom" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the identity homomorphism on <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span><span class="o">.</span><span class="n">identity_hom</span><span class="p">()</span>
<span class="go">Matrix([</span>
<span class="go">[1, 0], : QQ[x]**2 -&gt; QQ[x]**2</span>
<span class="go">[0, 1]])</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.FreeModule.is_submodule">
<span class="sig-name descname"><span class="pre">is_submodule</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">other</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L304-L326"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.FreeModule.is_submodule" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if <code class="docutils literal notranslate"><span class="pre">other</span></code> is a submodule of <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">M</span> <span class="o">=</span> <span class="n">F</span><span class="o">.</span><span class="n">submodule</span><span class="p">([</span><span class="mi">2</span><span class="p">,</span> <span class="n">x</span><span class="p">])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F</span><span class="o">.</span><span class="n">is_submodule</span><span class="p">(</span><span class="n">F</span><span class="p">)</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F</span><span class="o">.</span><span class="n">is_submodule</span><span class="p">(</span><span class="n">M</span><span class="p">)</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">M</span><span class="o">.</span><span class="n">is_submodule</span><span class="p">(</span><span class="n">F</span><span class="p">)</span>
<span class="go">False</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.FreeModule.is_zero">
<span class="sig-name descname"><span class="pre">is_zero</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L361-L378"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.FreeModule.is_zero" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if <code class="docutils literal notranslate"><span class="pre">self</span></code> is a zero module.</p>
<p>(If, as this implementation assumes, the coefficient ring is not the
zero ring, then this is equivalent to the rank being zero.)</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span><span class="o">.</span><span class="n">is_zero</span><span class="p">()</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="o">.</span><span class="n">is_zero</span><span class="p">()</span>
<span class="go">False</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.FreeModule.multiply_ideal">
<span class="sig-name descname"><span class="pre">multiply_ideal</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">other</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L416-L430"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.FreeModule.multiply_ideal" title="Permalink to this definition">¶</a></dt>
<dd><p>Multiply <code class="docutils literal notranslate"><span class="pre">self</span></code> by the ideal <code class="docutils literal notranslate"><span class="pre">other</span></code>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">I</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">ideal</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F</span><span class="o">.</span><span class="n">multiply_ideal</span><span class="p">(</span><span class="n">I</span><span class="p">)</span>
<span class="go">&lt;[x, 0], [0, x]&gt;</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.FreeModule.quotient_module">
<span class="sig-name descname"><span class="pre">quotient_module</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">submodule</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L396-L414"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.FreeModule.quotient_module" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a quotient module.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">M</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">M</span><span class="o">.</span><span class="n">quotient_module</span><span class="p">(</span><span class="n">M</span><span class="o">.</span><span class="n">submodule</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span> <span class="n">x</span><span class="p">],</span> <span class="p">[</span><span class="n">x</span><span class="p">,</span> <span class="mi">2</span><span class="p">]))</span>
<span class="go">QQ[x]**2/&lt;[1, x], [x, 2]&gt;</span>
</pre></div>
</div>
<p>Or more conicisely, using the overloaded division operator:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> <span class="o">/</span> <span class="p">[[</span><span class="mi">1</span><span class="p">,</span> <span class="n">x</span><span class="p">],</span> <span class="p">[</span><span class="n">x</span><span class="p">,</span> <span class="mi">2</span><span class="p">]]</span>
<span class="go">QQ[x]**2/&lt;[1, x], [x, 2]&gt;</span>
</pre></div>
</div>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.FreeModuleElement">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.agca.modules.</span></span><span class="sig-name descname"><span class="pre">FreeModuleElement</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">module</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">data</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L259-L279"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.FreeModuleElement" title="Permalink to this definition">¶</a></dt>
<dd><p>Element of a free module. Data stored as a tuple.</p>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.SubModule">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.agca.modules.</span></span><span class="sig-name descname"><span class="pre">SubModule</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">gens</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">container</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L602-L998"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.SubModule" title="Permalink to this definition">¶</a></dt>
<dd><p>Base class for submodules.</p>
<p>Attributes:</p>
<ul class="simple">
<li><p>container - containing module</p></li>
<li><p>gens - generators (subset of containing module)</p></li>
<li><p>rank - rank of containing module</p></li>
</ul>
<p>Non-implemented methods:</p>
<ul class="simple">
<li><p>_contains</p></li>
<li><p>_syzygies</p></li>
<li><p>_in_terms_of_generators</p></li>
<li><p>_intersect</p></li>
<li><p>_module_quotient</p></li>
</ul>
<p>Methods that likely need change in subclasses:</p>
<ul class="simple">
<li><p>reduce_element</p></li>
</ul>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.SubModule.convert">
<span class="sig-name descname"><span class="pre">convert</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">elem</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">M</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L649-L670"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.SubModule.convert" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert <code class="docutils literal notranslate"><span class="pre">elem</span></code> into the internal represantition.</p>
<p>Mostly called implicitly.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">M</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span><span class="o">.</span><span class="n">submodule</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span> <span class="n">x</span><span class="p">])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">M</span><span class="o">.</span><span class="n">convert</span><span class="p">([</span><span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="o">*</span><span class="n">x</span><span class="p">])</span>
<span class="go">[2, 2*x]</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.SubModule.identity_hom">
<span class="sig-name descname"><span class="pre">identity_hom</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L983-L998"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.SubModule.identity_hom" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the identity homomorphism on <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span><span class="o">.</span><span class="n">submodule</span><span class="p">([</span><span class="n">x</span><span class="p">,</span> <span class="n">x</span><span class="p">])</span><span class="o">.</span><span class="n">identity_hom</span><span class="p">()</span>
<span class="go">Matrix([</span>
<span class="go">[1, 0], : &lt;[x, x]&gt; -&gt; &lt;[x, x]&gt;</span>
<span class="go">[0, 1]])</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.SubModule.in_terms_of_generators">
<span class="sig-name descname"><span class="pre">in_terms_of_generators</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">e</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L887-L905"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.SubModule.in_terms_of_generators" title="Permalink to this definition">¶</a></dt>
<dd><p>Express element <code class="docutils literal notranslate"><span class="pre">e</span></code> of <code class="docutils literal notranslate"><span class="pre">self</span></code> in terms of the generators.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">M</span> <span class="o">=</span> <span class="n">F</span><span class="o">.</span><span class="n">submodule</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">],</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">M</span><span class="o">.</span><span class="n">in_terms_of_generators</span><span class="p">([</span><span class="n">x</span><span class="p">,</span> <span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">])</span>
<span class="go">[-x**2 + x, x**2]</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.SubModule.inclusion_hom">
<span class="sig-name descname"><span class="pre">inclusion_hom</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L965-L981"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.SubModule.inclusion_hom" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a homomorphism representing the inclusion map of <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
<p>That is, the natural map from <code class="docutils literal notranslate"><span class="pre">self</span></code> to <code class="docutils literal notranslate"><span class="pre">self.container</span></code>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span><span class="o">.</span><span class="n">submodule</span><span class="p">([</span><span class="n">x</span><span class="p">,</span> <span class="n">x</span><span class="p">])</span><span class="o">.</span><span class="n">inclusion_hom</span><span class="p">()</span>
<span class="go">Matrix([</span>
<span class="go">[1, 0], : &lt;[x, x]&gt; -&gt; QQ[x]**2</span>
<span class="go">[0, 1]])</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.SubModule.intersect">
<span class="sig-name descname"><span class="pre">intersect</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">other</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">options</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L682-L715"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.SubModule.intersect" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the intersection of <code class="docutils literal notranslate"><span class="pre">self</span></code> with submodule <code class="docutils literal notranslate"><span class="pre">other</span></code>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F</span><span class="o">.</span><span class="n">submodule</span><span class="p">([</span><span class="n">x</span><span class="p">,</span> <span class="n">x</span><span class="p">])</span><span class="o">.</span><span class="n">intersect</span><span class="p">(</span><span class="n">F</span><span class="o">.</span><span class="n">submodule</span><span class="p">([</span><span class="n">y</span><span class="p">,</span> <span class="n">y</span><span class="p">]))</span>
<span class="go">&lt;[x*y, x*y]&gt;</span>
</pre></div>
</div>
<p>Some implementation allow further options to be passed. Currently, to
only one implemented is <code class="docutils literal notranslate"><span class="pre">relations=True</span></code>, in which case the function
will return a triple <code class="docutils literal notranslate"><span class="pre">(res,</span> <span class="pre">rela,</span> <span class="pre">relb)</span></code>, where <code class="docutils literal notranslate"><span class="pre">res</span></code> is the
intersection module, and <code class="docutils literal notranslate"><span class="pre">rela</span></code> and <code class="docutils literal notranslate"><span class="pre">relb</span></code> are lists of coefficient
vectors, expressing the generators of <code class="docutils literal notranslate"><span class="pre">res</span></code> in terms of the
generators of <code class="docutils literal notranslate"><span class="pre">self</span></code> (<code class="docutils literal notranslate"><span class="pre">rela</span></code>) and <code class="docutils literal notranslate"><span class="pre">other</span></code> (<code class="docutils literal notranslate"><span class="pre">relb</span></code>).</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">F</span><span class="o">.</span><span class="n">submodule</span><span class="p">([</span><span class="n">x</span><span class="p">,</span> <span class="n">x</span><span class="p">])</span><span class="o">.</span><span class="n">intersect</span><span class="p">(</span><span class="n">F</span><span class="o">.</span><span class="n">submodule</span><span class="p">([</span><span class="n">y</span><span class="p">,</span> <span class="n">y</span><span class="p">]),</span> <span class="n">relations</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="go">(&lt;[x*y, x*y]&gt;, [(y,)], [(x,)])</span>
</pre></div>
</div>
<p>The above result says: the intersection module is generated by the
single element <span class="math notranslate nohighlight">\((-xy, -xy) = -y (x, x) = -x (y, y)\)</span>, where
<span class="math notranslate nohighlight">\((x, x)\)</span> and <span class="math notranslate nohighlight">\((y, y)\)</span> respectively are the unique generators of
the two modules being intersected.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.SubModule.is_full_module">
<span class="sig-name descname"><span class="pre">is_full_module</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L813-L828"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.SubModule.is_full_module" title="Permalink to this definition">¶</a></dt>
<dd><p>Return True if <code class="docutils literal notranslate"><span class="pre">self</span></code> is the entire free module.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F</span><span class="o">.</span><span class="n">submodule</span><span class="p">([</span><span class="n">x</span><span class="p">,</span> <span class="mi">1</span><span class="p">])</span><span class="o">.</span><span class="n">is_full_module</span><span class="p">()</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F</span><span class="o">.</span><span class="n">submodule</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">],</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">])</span><span class="o">.</span><span class="n">is_full_module</span><span class="p">()</span>
<span class="go">True</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.SubModule.is_submodule">
<span class="sig-name descname"><span class="pre">is_submodule</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">other</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L830-L851"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.SubModule.is_submodule" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if <code class="docutils literal notranslate"><span class="pre">other</span></code> is a submodule of <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">M</span> <span class="o">=</span> <span class="n">F</span><span class="o">.</span><span class="n">submodule</span><span class="p">([</span><span class="mi">2</span><span class="p">,</span> <span class="n">x</span><span class="p">])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">N</span> <span class="o">=</span> <span class="n">M</span><span class="o">.</span><span class="n">submodule</span><span class="p">([</span><span class="mi">2</span><span class="o">*</span><span class="n">x</span><span class="p">,</span> <span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">M</span><span class="o">.</span><span class="n">is_submodule</span><span class="p">(</span><span class="n">M</span><span class="p">)</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">M</span><span class="o">.</span><span class="n">is_submodule</span><span class="p">(</span><span class="n">N</span><span class="p">)</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">N</span><span class="o">.</span><span class="n">is_submodule</span><span class="p">(</span><span class="n">M</span><span class="p">)</span>
<span class="go">False</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.SubModule.is_zero">
<span class="sig-name descname"><span class="pre">is_zero</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L779-L794"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.SubModule.is_zero" title="Permalink to this definition">¶</a></dt>
<dd><p>Return True if <code class="docutils literal notranslate"><span class="pre">self</span></code> is a zero module.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F</span><span class="o">.</span><span class="n">submodule</span><span class="p">([</span><span class="n">x</span><span class="p">,</span> <span class="mi">1</span><span class="p">])</span><span class="o">.</span><span class="n">is_zero</span><span class="p">()</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F</span><span class="o">.</span><span class="n">submodule</span><span class="p">([</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">])</span><span class="o">.</span><span class="n">is_zero</span><span class="p">()</span>
<span class="go">True</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.SubModule.module_quotient">
<span class="sig-name descname"><span class="pre">module_quotient</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">other</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">options</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L717-L755"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.SubModule.module_quotient" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the module quotient of <code class="docutils literal notranslate"><span class="pre">self</span></code> by submodule <code class="docutils literal notranslate"><span class="pre">other</span></code>.</p>
<p>That is, if <code class="docutils literal notranslate"><span class="pre">self</span></code> is the module <span class="math notranslate nohighlight">\(M\)</span> and <code class="docutils literal notranslate"><span class="pre">other</span></code> is <span class="math notranslate nohighlight">\(N\)</span>, then
return the ideal <span class="math notranslate nohighlight">\(\{f \in R | fN \subset M\}\)</span>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">S</span> <span class="o">=</span> <span class="n">F</span><span class="o">.</span><span class="n">submodule</span><span class="p">([</span><span class="n">x</span><span class="o">*</span><span class="n">y</span><span class="p">,</span> <span class="n">x</span><span class="o">*</span><span class="n">y</span><span class="p">])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">T</span> <span class="o">=</span> <span class="n">F</span><span class="o">.</span><span class="n">submodule</span><span class="p">([</span><span class="n">x</span><span class="p">,</span> <span class="n">x</span><span class="p">])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">S</span><span class="o">.</span><span class="n">module_quotient</span><span class="p">(</span><span class="n">T</span><span class="p">)</span>
<span class="go">&lt;y&gt;</span>
</pre></div>
</div>
<p>Some implementations allow further options to be passed. Currently, the
only one implemented is <code class="docutils literal notranslate"><span class="pre">relations=True</span></code>, which may only be passed
if <code class="docutils literal notranslate"><span class="pre">other</span></code> is principal. In this case the function
will return a pair <code class="docutils literal notranslate"><span class="pre">(res,</span> <span class="pre">rel)</span></code> where <code class="docutils literal notranslate"><span class="pre">res</span></code> is the ideal, and
<code class="docutils literal notranslate"><span class="pre">rel</span></code> is a list of coefficient vectors, expressing the generators of
the ideal, multiplied by the generator of <code class="docutils literal notranslate"><span class="pre">other</span></code> in terms of
generators of <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">S</span><span class="o">.</span><span class="n">module_quotient</span><span class="p">(</span><span class="n">T</span><span class="p">,</span> <span class="n">relations</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="go">(&lt;y&gt;, [[1]])</span>
</pre></div>
</div>
<p>This means that the quotient ideal is generated by the single element
<span class="math notranslate nohighlight">\(y\)</span>, and that <span class="math notranslate nohighlight">\(y (x, x) = 1 (xy, xy)\)</span>, <span class="math notranslate nohighlight">\((x, x)\)</span> and <span class="math notranslate nohighlight">\((xy, xy)\)</span> being
the generators of <span class="math notranslate nohighlight">\(T\)</span> and <span class="math notranslate nohighlight">\(S\)</span>, respectively.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.SubModule.multiply_ideal">
<span class="sig-name descname"><span class="pre">multiply_ideal</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">I</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L949-L963"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.SubModule.multiply_ideal" title="Permalink to this definition">¶</a></dt>
<dd><p>Multiply <code class="docutils literal notranslate"><span class="pre">self</span></code> by the ideal <code class="docutils literal notranslate"><span class="pre">I</span></code>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">I</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">ideal</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">M</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span><span class="o">.</span><span class="n">submodule</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">I</span><span class="o">*</span><span class="n">M</span>
<span class="go">&lt;[x**2, x**2]&gt;</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.SubModule.quotient_module">
<span class="sig-name descname"><span class="pre">quotient_module</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">other</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">opts</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L916-L942"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.SubModule.quotient_module" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a quotient module.</p>
<p>This is the same as taking a submodule of a quotient of the containing
module.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">S1</span> <span class="o">=</span> <span class="n">F</span><span class="o">.</span><span class="n">submodule</span><span class="p">([</span><span class="n">x</span><span class="p">,</span> <span class="mi">1</span><span class="p">])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">S2</span> <span class="o">=</span> <span class="n">F</span><span class="o">.</span><span class="n">submodule</span><span class="p">([</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="n">x</span><span class="p">])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">S1</span><span class="o">.</span><span class="n">quotient_module</span><span class="p">(</span><span class="n">S2</span><span class="p">)</span>
<span class="go">&lt;[x, 1] + &lt;[x**2, x]&gt;&gt;</span>
</pre></div>
</div>
<p>Or more coincisely, using the overloaded division operator:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">F</span><span class="o">.</span><span class="n">submodule</span><span class="p">([</span><span class="n">x</span><span class="p">,</span> <span class="mi">1</span><span class="p">])</span> <span class="o">/</span> <span class="p">[(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="n">x</span><span class="p">)]</span>
<span class="go">&lt;[x, 1] + &lt;[x**2, x]&gt;&gt;</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.SubModule.reduce_element">
<span class="sig-name descname"><span class="pre">reduce_element</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L907-L914"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.SubModule.reduce_element" title="Permalink to this definition">¶</a></dt>
<dd><p>Reduce the element <code class="docutils literal notranslate"><span class="pre">x</span></code> of our ring modulo the ideal <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
<p>Here “reduce” has no specific meaning, it could return a unique normal
form, simplify the expression a bit, or just do nothing.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.SubModule.submodule">
<span class="sig-name descname"><span class="pre">submodule</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">gens</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L796-L811"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.SubModule.submodule" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate a submodule.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">M</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span><span class="o">.</span><span class="n">submodule</span><span class="p">([</span><span class="n">x</span><span class="p">,</span> <span class="mi">1</span><span class="p">])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">M</span><span class="o">.</span><span class="n">submodule</span><span class="p">([</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="n">x</span><span class="p">])</span>
<span class="go">&lt;[x**2, x]&gt;</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.SubModule.syzygy_module">
<span class="sig-name descname"><span class="pre">syzygy_module</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">opts</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L853-L885"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.SubModule.syzygy_module" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the syzygy module of the generators of <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
<p>Suppose <span class="math notranslate nohighlight">\(M\)</span> is generated by <span class="math notranslate nohighlight">\(f_1, \ldots, f_n\)</span> over the ring
<span class="math notranslate nohighlight">\(R\)</span>. Consider the homomorphism <span class="math notranslate nohighlight">\(\phi: R^n \to M\)</span>, given by
sending <span class="math notranslate nohighlight">\((r_1, \ldots, r_n) \to r_1 f_1 + \cdots + r_n f_n\)</span>.
The syzygy module is defined to be the kernel of <span class="math notranslate nohighlight">\(\phi\)</span>.</p>
<p class="rubric">Examples</p>
<p>The syzygy module is zero iff the generators generate freely a free
submodule:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span><span class="o">.</span><span class="n">submodule</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">],</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">])</span><span class="o">.</span><span class="n">syzygy_module</span><span class="p">()</span><span class="o">.</span><span class="n">is_zero</span><span class="p">()</span>
<span class="go">True</span>
</pre></div>
</div>
<p>A slightly more interesting example:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">M</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span><span class="o">.</span><span class="n">submodule</span><span class="p">([</span><span class="n">x</span><span class="p">,</span> <span class="mi">2</span><span class="o">*</span><span class="n">x</span><span class="p">],</span> <span class="p">[</span><span class="n">y</span><span class="p">,</span> <span class="mi">2</span><span class="o">*</span><span class="n">y</span><span class="p">])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">S</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span><span class="o">.</span><span class="n">submodule</span><span class="p">([</span><span class="n">y</span><span class="p">,</span> <span class="o">-</span><span class="n">x</span><span class="p">])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">M</span><span class="o">.</span><span class="n">syzygy_module</span><span class="p">()</span> <span class="o">==</span> <span class="n">S</span>
<span class="go">True</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.SubModule.union">
<span class="sig-name descname"><span class="pre">union</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">other</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L757-L777"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.SubModule.union" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the module generated by the union of <code class="docutils literal notranslate"><span class="pre">self</span></code> and <code class="docutils literal notranslate"><span class="pre">other</span></code>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">M</span> <span class="o">=</span> <span class="n">F</span><span class="o">.</span><span class="n">submodule</span><span class="p">([</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">x</span><span class="p">])</span> <span class="c1"># &lt;x(x+1)&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">N</span> <span class="o">=</span> <span class="n">F</span><span class="o">.</span><span class="n">submodule</span><span class="p">([</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="mi">1</span><span class="p">])</span> <span class="c1"># &lt;(x-1)(x+1)&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">M</span><span class="o">.</span><span class="n">union</span><span class="p">(</span><span class="n">N</span><span class="p">)</span> <span class="o">==</span> <span class="n">F</span><span class="o">.</span><span class="n">submodule</span><span class="p">([</span><span class="n">x</span><span class="o">+</span><span class="mi">1</span><span class="p">])</span>
<span class="go">True</span>
</pre></div>
</div>
</dd></dl>

</dd></dl>

<p>Ideals are created very similarly to modules. For example, let’s verify
that the nodal cubic is indeed singular at the origin:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">I</span> <span class="o">=</span> <span class="n">lr</span><span class="o">.</span><span class="n">ideal</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">I</span> <span class="o">==</span> <span class="n">lr</span><span class="o">.</span><span class="n">ideal</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">False</span>

<span class="gp">&gt;&gt;&gt; </span><span class="n">I</span> <span class="o">==</span> <span class="n">lr</span><span class="o">.</span><span class="n">ideal</span><span class="p">(</span><span class="n">y</span><span class="p">)</span>
<span class="go">False</span>
</pre></div>
</div>
<p>We are using here the fact that a curve is non-singular at a point if and only
if the maximal ideal of the local ring is principal, and that in this case at
least one of <span class="math notranslate nohighlight">\(x\)</span> and <span class="math notranslate nohighlight">\(y\)</span> must be generators.</p>
<p>This is the detailed documentation of the class ideal. Please note that most
of the methods regarding properties of ideals (primality etc.) are not yet
implemented.</p>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.agca.ideals.Ideal">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.agca.ideals.</span></span><span class="sig-name descname"><span class="pre">Ideal</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">ring</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/ideals.py#L8-L278"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.ideals.Ideal" title="Permalink to this definition">¶</a></dt>
<dd><p>Abstract base class for ideals.</p>
<p>Do not instantiate - use explicit constructors in the ring class instead:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">ideal</span><span class="p">(</span><span class="n">x</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span>
<span class="go">&lt;x + 1&gt;</span>
</pre></div>
</div>
<p>Attributes</p>
<ul class="simple">
<li><p>ring - the ring this ideal belongs to</p></li>
</ul>
<p>Non-implemented methods:</p>
<ul class="simple">
<li><p>_contains_elem</p></li>
<li><p>_contains_ideal</p></li>
<li><p>_quotient</p></li>
<li><p>_intersect</p></li>
<li><p>_union</p></li>
<li><p>_product</p></li>
<li><p>is_whole_ring</p></li>
<li><p>is_zero</p></li>
<li><p>is_prime, is_maximal, is_primary, is_radical</p></li>
<li><p>is_principal</p></li>
<li><p>height, depth</p></li>
<li><p>radical</p></li>
</ul>
<p>Methods that likely should be overridden in subclasses:</p>
<ul class="simple">
<li><p>reduce_element</p></li>
</ul>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.ideals.Ideal.contains">
<span class="sig-name descname"><span class="pre">contains</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">elem</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/ideals.py#L116-L130"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.ideals.Ideal.contains" title="Permalink to this definition">¶</a></dt>
<dd><p>Return True if <code class="docutils literal notranslate"><span class="pre">elem</span></code> is an element of this ideal.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">ideal</span><span class="p">(</span><span class="n">x</span><span class="o">+</span><span class="mi">1</span><span class="p">,</span> <span class="n">x</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span><span class="o">.</span><span class="n">contains</span><span class="p">(</span><span class="mi">3</span><span class="p">)</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">ideal</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="n">x</span><span class="o">**</span><span class="mi">3</span><span class="p">)</span><span class="o">.</span><span class="n">contains</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">False</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.ideals.Ideal.depth">
<span class="sig-name descname"><span class="pre">depth</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/ideals.py#L95-L97"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.ideals.Ideal.depth" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the depth of <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.ideals.Ideal.height">
<span class="sig-name descname"><span class="pre">height</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/ideals.py#L99-L101"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.ideals.Ideal.height" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the height of <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.ideals.Ideal.intersect">
<span class="sig-name descname"><span class="pre">intersect</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">J</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/ideals.py#L174-L188"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.ideals.Ideal.intersect" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the intersection of self with ideal J.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">R</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">R</span><span class="o">.</span><span class="n">ideal</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">intersect</span><span class="p">(</span><span class="n">R</span><span class="o">.</span><span class="n">ideal</span><span class="p">(</span><span class="n">y</span><span class="p">))</span>
<span class="go">&lt;x*y&gt;</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.ideals.Ideal.is_maximal">
<span class="sig-name descname"><span class="pre">is_maximal</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/ideals.py#L75-L77"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.ideals.Ideal.is_maximal" title="Permalink to this definition">¶</a></dt>
<dd><p>Return True if <code class="docutils literal notranslate"><span class="pre">self</span></code> is a maximal ideal.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.ideals.Ideal.is_primary">
<span class="sig-name descname"><span class="pre">is_primary</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/ideals.py#L83-L85"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.ideals.Ideal.is_primary" title="Permalink to this definition">¶</a></dt>
<dd><p>Return True if <code class="docutils literal notranslate"><span class="pre">self</span></code> is a primary ideal.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.ideals.Ideal.is_prime">
<span class="sig-name descname"><span class="pre">is_prime</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/ideals.py#L71-L73"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.ideals.Ideal.is_prime" title="Permalink to this definition">¶</a></dt>
<dd><p>Return True if <code class="docutils literal notranslate"><span class="pre">self</span></code> is a prime ideal.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.ideals.Ideal.is_principal">
<span class="sig-name descname"><span class="pre">is_principal</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/ideals.py#L87-L89"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.ideals.Ideal.is_principal" title="Permalink to this definition">¶</a></dt>
<dd><p>Return True if <code class="docutils literal notranslate"><span class="pre">self</span></code> is a principal ideal.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.ideals.Ideal.is_radical">
<span class="sig-name descname"><span class="pre">is_radical</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/ideals.py#L79-L81"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.ideals.Ideal.is_radical" title="Permalink to this definition">¶</a></dt>
<dd><p>Return True if <code class="docutils literal notranslate"><span class="pre">self</span></code> is a radical ideal.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.ideals.Ideal.is_whole_ring">
<span class="sig-name descname"><span class="pre">is_whole_ring</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/ideals.py#L59-L61"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.ideals.Ideal.is_whole_ring" title="Permalink to this definition">¶</a></dt>
<dd><p>Return True if <code class="docutils literal notranslate"><span class="pre">self</span></code> is the whole ring.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.ideals.Ideal.is_zero">
<span class="sig-name descname"><span class="pre">is_zero</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/ideals.py#L63-L65"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.ideals.Ideal.is_zero" title="Permalink to this definition">¶</a></dt>
<dd><p>Return True if <code class="docutils literal notranslate"><span class="pre">self</span></code> is the zero ideal.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.ideals.Ideal.product">
<span class="sig-name descname"><span class="pre">product</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">J</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/ideals.py#L215-L231"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.ideals.Ideal.product" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the ideal product of <code class="docutils literal notranslate"><span class="pre">self</span></code> and <code class="docutils literal notranslate"><span class="pre">J</span></code>.</p>
<p>That is, compute the ideal generated by products <span class="math notranslate nohighlight">\(xy\)</span>, for <span class="math notranslate nohighlight">\(x\)</span> an element
of <code class="docutils literal notranslate"><span class="pre">self</span></code> and <span class="math notranslate nohighlight">\(y \in J\)</span>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">)</span><span class="o">.</span><span class="n">ideal</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">product</span><span class="p">(</span><span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">)</span><span class="o">.</span><span class="n">ideal</span><span class="p">(</span><span class="n">y</span><span class="p">))</span>
<span class="go">&lt;x*y&gt;</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.ideals.Ideal.quotient">
<span class="sig-name descname"><span class="pre">quotient</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">J</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">opts</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/ideals.py#L155-L172"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.ideals.Ideal.quotient" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the ideal quotient of <code class="docutils literal notranslate"><span class="pre">self</span></code> by <code class="docutils literal notranslate"><span class="pre">J</span></code>.</p>
<p>That is, if <code class="docutils literal notranslate"><span class="pre">self</span></code> is the ideal <span class="math notranslate nohighlight">\(I\)</span>, compute the set
<span class="math notranslate nohighlight">\(I : J = \{x \in R | xJ \subset I \}\)</span>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">R</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">R</span><span class="o">.</span><span class="n">ideal</span><span class="p">(</span><span class="n">x</span><span class="o">*</span><span class="n">y</span><span class="p">)</span><span class="o">.</span><span class="n">quotient</span><span class="p">(</span><span class="n">R</span><span class="o">.</span><span class="n">ideal</span><span class="p">(</span><span class="n">x</span><span class="p">))</span>
<span class="go">&lt;y&gt;</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.ideals.Ideal.radical">
<span class="sig-name descname"><span class="pre">radical</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/ideals.py#L91-L93"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.ideals.Ideal.radical" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the radical of <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.ideals.Ideal.reduce_element">
<span class="sig-name descname"><span class="pre">reduce_element</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/ideals.py#L233-L240"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.ideals.Ideal.reduce_element" title="Permalink to this definition">¶</a></dt>
<dd><p>Reduce the element <code class="docutils literal notranslate"><span class="pre">x</span></code> of our ring modulo the ideal <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
<p>Here “reduce” has no specific meaning: it could return a unique normal
form, simplify the expression a bit, or just do nothing.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.ideals.Ideal.saturate">
<span class="sig-name descname"><span class="pre">saturate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">J</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/ideals.py#L190-L198"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.ideals.Ideal.saturate" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the ideal saturation of <code class="docutils literal notranslate"><span class="pre">self</span></code> by <code class="docutils literal notranslate"><span class="pre">J</span></code>.</p>
<p>That is, if <code class="docutils literal notranslate"><span class="pre">self</span></code> is the ideal <span class="math notranslate nohighlight">\(I\)</span>, compute the set
<span class="math notranslate nohighlight">\(I : J^\infty = \{x \in R | xJ^n \subset I \text{ for some } n\}\)</span>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.ideals.Ideal.subset">
<span class="sig-name descname"><span class="pre">subset</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">other</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/ideals.py#L132-L153"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.ideals.Ideal.subset" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if <code class="docutils literal notranslate"><span class="pre">other</span></code> is is a subset of <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
<p>Here <code class="docutils literal notranslate"><span class="pre">other</span></code> may be an ideal.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">I</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">ideal</span><span class="p">(</span><span class="n">x</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">I</span><span class="o">.</span><span class="n">subset</span><span class="p">([</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="mi">1</span><span class="p">,</span> <span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">2</span><span class="o">*</span><span class="n">x</span> <span class="o">+</span> <span class="mi">1</span><span class="p">])</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">I</span><span class="o">.</span><span class="n">subset</span><span class="p">([</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">x</span> <span class="o">+</span> <span class="mi">1</span><span class="p">])</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">I</span><span class="o">.</span><span class="n">subset</span><span class="p">(</span><span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">ideal</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="mi">1</span><span class="p">))</span>
<span class="go">True</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.ideals.Ideal.union">
<span class="sig-name descname"><span class="pre">union</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">J</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/ideals.py#L200-L213"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.ideals.Ideal.union" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the ideal generated by the union of <code class="docutils literal notranslate"><span class="pre">self</span></code> and <code class="docutils literal notranslate"><span class="pre">J</span></code>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">ideal</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span><span class="o">.</span><span class="n">union</span><span class="p">(</span><span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">ideal</span><span class="p">((</span><span class="n">x</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span><span class="o">**</span><span class="mi">2</span><span class="p">))</span> <span class="o">==</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">ideal</span><span class="p">(</span><span class="n">x</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span>
<span class="go">True</span>
</pre></div>
</div>
</dd></dl>

</dd></dl>

<p>If <span class="math notranslate nohighlight">\(M\)</span> is an <span class="math notranslate nohighlight">\(A\)</span>-module and <span class="math notranslate nohighlight">\(N\)</span> is an <span class="math notranslate nohighlight">\(A\)</span>-submodule, we can define two elements
<span class="math notranslate nohighlight">\(x\)</span> and <span class="math notranslate nohighlight">\(y\)</span> of <span class="math notranslate nohighlight">\(M\)</span> to be equivalent if <span class="math notranslate nohighlight">\(x - y \in N\)</span>. The set of equivalence
classes is written <span class="math notranslate nohighlight">\(M/N\)</span>, and has a natural <span class="math notranslate nohighlight">\(A\)</span>-module structure. This is
called the quotient module of <span class="math notranslate nohighlight">\(M\)</span> by <span class="math notranslate nohighlight">\(N\)</span>. If <span class="math notranslate nohighlight">\(K\)</span> is a submodule of <span class="math notranslate nohighlight">\(M\)</span>
containing <span class="math notranslate nohighlight">\(N\)</span>, then <span class="math notranslate nohighlight">\(K/N\)</span> is in a natural way a submodule of <span class="math notranslate nohighlight">\(M/N\)</span>. Such a
module is called a subquotient. Here is the documentation of quotient and
subquotient modules:</p>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.QuotientModule">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.agca.modules.</span></span><span class="sig-name descname"><span class="pre">QuotientModule</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">ring</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">base</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">submodule</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L1334-L1483"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.QuotientModule" title="Permalink to this definition">¶</a></dt>
<dd><p>Class for quotient modules.</p>
<p>Do not instantiate this directly. For subquotients, see the
SubQuotientModule class.</p>
<p>Attributes:</p>
<ul class="simple">
<li><p>base - the base module we are a quotient of</p></li>
<li><p>killed_module - the submodule used to form the quotient</p></li>
<li><p>rank of the base</p></li>
</ul>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.QuotientModule.convert">
<span class="sig-name descname"><span class="pre">convert</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">elem</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">M</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L1422-L1444"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.QuotientModule.convert" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert <code class="docutils literal notranslate"><span class="pre">elem</span></code> into the internal representation.</p>
<p>This method is called implicitly whenever computations involve elements
not in the internal representation.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> <span class="o">/</span> <span class="p">[(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">x</span><span class="p">)]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F</span><span class="o">.</span><span class="n">convert</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">])</span>
<span class="go">[1, 0] + &lt;[1, 2], [1, x]&gt;</span>
</pre></div>
</div>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.QuotientModule.dtype">
<span class="sig-name descname"><span class="pre">dtype</span></span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L1323-L1331"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.QuotientModule.dtype" title="Permalink to this definition">¶</a></dt>
<dd><p>alias of <a class="reference internal" href="#sympy.polys.agca.modules.QuotientModuleElement" title="sympy.polys.agca.modules.QuotientModuleElement"><code class="xref py py-class docutils literal notranslate"><span class="pre">sympy.polys.agca.modules.QuotientModuleElement</span></code></a></p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.QuotientModule.identity_hom">
<span class="sig-name descname"><span class="pre">identity_hom</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L1446-L1462"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.QuotientModule.identity_hom" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the identity homomorphism on <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">M</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> <span class="o">/</span> <span class="p">[(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">x</span><span class="p">)]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">M</span><span class="o">.</span><span class="n">identity_hom</span><span class="p">()</span>
<span class="go">Matrix([</span>
<span class="go">[1, 0], : QQ[x]**2/&lt;[1, 2], [1, x]&gt; -&gt; QQ[x]**2/&lt;[1, 2], [1, x]&gt;</span>
<span class="go">[0, 1]])</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.QuotientModule.is_submodule">
<span class="sig-name descname"><span class="pre">is_submodule</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">other</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L1381-L1402"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.QuotientModule.is_submodule" title="Permalink to this definition">¶</a></dt>
<dd><p>Return True if <code class="docutils literal notranslate"><span class="pre">other</span></code> is a submodule of <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Q</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> <span class="o">/</span> <span class="p">[(</span><span class="n">x</span><span class="p">,</span> <span class="n">x</span><span class="p">)]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">S</span> <span class="o">=</span> <span class="n">Q</span><span class="o">.</span><span class="n">submodule</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Q</span><span class="o">.</span><span class="n">is_submodule</span><span class="p">(</span><span class="n">S</span><span class="p">)</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">S</span><span class="o">.</span><span class="n">is_submodule</span><span class="p">(</span><span class="n">Q</span><span class="p">)</span>
<span class="go">False</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.QuotientModule.is_zero">
<span class="sig-name descname"><span class="pre">is_zero</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L1361-L1379"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.QuotientModule.is_zero" title="Permalink to this definition">¶</a></dt>
<dd><p>Return True if <code class="docutils literal notranslate"><span class="pre">self</span></code> is a zero module.</p>
<p>This happens if and only if the base module is the same as the
submodule being killed.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="p">(</span><span class="n">F</span><span class="o">/</span><span class="p">[(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">)])</span><span class="o">.</span><span class="n">is_zero</span><span class="p">()</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="p">(</span><span class="n">F</span><span class="o">/</span><span class="p">[(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">)])</span><span class="o">.</span><span class="n">is_zero</span><span class="p">()</span>
<span class="go">True</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.QuotientModule.quotient_hom">
<span class="sig-name descname"><span class="pre">quotient_hom</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L1464-L1483"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.QuotientModule.quotient_hom" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the quotient homomorphism to <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
<p>That is, return a homomorphism representing the natural map from
<code class="docutils literal notranslate"><span class="pre">self.base</span></code> to <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">M</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> <span class="o">/</span> <span class="p">[(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">x</span><span class="p">)]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">M</span><span class="o">.</span><span class="n">quotient_hom</span><span class="p">()</span>
<span class="go">Matrix([</span>
<span class="go">[1, 0], : QQ[x]**2 -&gt; QQ[x]**2/&lt;[1, 2], [1, x]&gt;</span>
<span class="go">[0, 1]])</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.QuotientModule.submodule">
<span class="sig-name descname"><span class="pre">submodule</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">gens</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">opts</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L1404-L1420"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.QuotientModule.submodule" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate a submodule.</p>
<p>This is the same as taking a quotient of a submodule of the base
module.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Q</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> <span class="o">/</span> <span class="p">[(</span><span class="n">x</span><span class="p">,</span> <span class="n">x</span><span class="p">)]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Q</span><span class="o">.</span><span class="n">submodule</span><span class="p">([</span><span class="n">x</span><span class="p">,</span> <span class="mi">0</span><span class="p">])</span>
<span class="go">&lt;[x, 0] + &lt;[x, x]&gt;&gt;</span>
</pre></div>
</div>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.QuotientModuleElement">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.agca.modules.</span></span><span class="sig-name descname"><span class="pre">QuotientModuleElement</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">module</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">data</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L1323-L1331"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.QuotientModuleElement" title="Permalink to this definition">¶</a></dt>
<dd><p>Element of a quotient module.</p>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.QuotientModuleElement.eq">
<span class="sig-name descname"><span class="pre">eq</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">d1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">d2</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L1326-L1328"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.QuotientModuleElement.eq" title="Permalink to this definition">¶</a></dt>
<dd><p>Equality comparison.</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.SubQuotientModule">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.agca.modules.</span></span><span class="sig-name descname"><span class="pre">SubQuotientModule</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">gens</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">container</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">opts</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L1001-L1085"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.SubQuotientModule" title="Permalink to this definition">¶</a></dt>
<dd><p>Submodule of a quotient module.</p>
<p>Equivalently, quotient module of a submodule.</p>
<p>Do not instantiate this, instead use the submodule or quotient_module
constructing methods:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">S</span> <span class="o">=</span> <span class="n">F</span><span class="o">.</span><span class="n">submodule</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">],</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="n">x</span><span class="p">])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Q</span> <span class="o">=</span> <span class="n">F</span><span class="o">/</span><span class="p">[(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">)]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">S</span><span class="o">/</span><span class="p">[(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">)]</span> <span class="o">==</span> <span class="n">Q</span><span class="o">.</span><span class="n">submodule</span><span class="p">([</span><span class="mi">5</span><span class="p">,</span> <span class="n">x</span><span class="p">])</span>
<span class="go">True</span>
</pre></div>
</div>
<p>Attributes:</p>
<ul class="simple">
<li><p>base - base module we are quotient of</p></li>
<li><p>killed_module - submodule used to form the quotient</p></li>
</ul>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.SubQuotientModule.is_full_module">
<span class="sig-name descname"><span class="pre">is_full_module</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L1051-L1066"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.SubQuotientModule.is_full_module" title="Permalink to this definition">¶</a></dt>
<dd><p>Return True if <code class="docutils literal notranslate"><span class="pre">self</span></code> is the entire free module.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F</span><span class="o">.</span><span class="n">submodule</span><span class="p">([</span><span class="n">x</span><span class="p">,</span> <span class="mi">1</span><span class="p">])</span><span class="o">.</span><span class="n">is_full_module</span><span class="p">()</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F</span><span class="o">.</span><span class="n">submodule</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">],</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">])</span><span class="o">.</span><span class="n">is_full_module</span><span class="p">()</span>
<span class="go">True</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.modules.SubQuotientModule.quotient_hom">
<span class="sig-name descname"><span class="pre">quotient_hom</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/modules.py#L1068-L1085"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.modules.SubQuotientModule.quotient_hom" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the quotient homomorphism to self.</p>
<p>That is, return the natural map from <code class="docutils literal notranslate"><span class="pre">self.base</span></code> to <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">M</span> <span class="o">=</span> <span class="p">(</span><span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> <span class="o">/</span> <span class="p">[(</span><span class="mi">1</span><span class="p">,</span> <span class="n">x</span><span class="p">)])</span><span class="o">.</span><span class="n">submodule</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">M</span><span class="o">.</span><span class="n">quotient_hom</span><span class="p">()</span>
<span class="go">Matrix([</span>
<span class="go">[1, 0], : &lt;[1, 0], [1, x]&gt; -&gt; &lt;[1, 0] + &lt;[1, x]&gt;, [1, x] + &lt;[1, x]&gt;&gt;</span>
<span class="go">[0, 1]])</span>
</pre></div>
</div>
</dd></dl>

</dd></dl>

</section>
<section id="module-homomorphisms-and-syzygies">
<h3>Module Homomorphisms and Syzygies<a class="headerlink" href="#module-homomorphisms-and-syzygies" title="Permalink to this headline">¶</a></h3>
<p>Let <span class="math notranslate nohighlight">\(M\)</span> and <span class="math notranslate nohighlight">\(N\)</span> be <span class="math notranslate nohighlight">\(A\)</span>-modules. A mapping <span class="math notranslate nohighlight">\(f: M \to N\)</span> satisfying various
obvious properties (see <a class="reference internal" href="literature.html#atiyah69" id="id4"><span>[Atiyah69]</span></a>) is called an <span class="math notranslate nohighlight">\(A\)</span>-module homomorphism.
In this case <span class="math notranslate nohighlight">\(M\)</span> is called the <em>domain</em> and <em>N</em> the <em>codomain</em>. The
set <span class="math notranslate nohighlight">\(\{x \in M | f(x) = 0\}\)</span> is called the <em>kernel</em> <span class="math notranslate nohighlight">\(ker(f)\)</span>, whereas the
set <span class="math notranslate nohighlight">\(\{f(x) | x \in M\}\)</span> is called the <em>image</em> <span class="math notranslate nohighlight">\(im(f)\)</span>.
The kernel is a submodule of <span class="math notranslate nohighlight">\(M\)</span>, the image is a submodule of <span class="math notranslate nohighlight">\(N\)</span>.
The homomorphism <span class="math notranslate nohighlight">\(f\)</span> is injective if and only if <span class="math notranslate nohighlight">\(ker(f) = 0\)</span> and surjective
if and only if <span class="math notranslate nohighlight">\(im(f) = N\)</span>.
A bijective homomorphism is called an <em>isomorphism</em>. Equivalently, <span class="math notranslate nohighlight">\(ker(f) = 0\)</span>
and <span class="math notranslate nohighlight">\(im(f) = N\)</span>. (A related notion, which currently has no special name in
the AGCA module, is that of the <em>cokernel</em>, <span class="math notranslate nohighlight">\(coker(f) = N/im(f)\)</span>.)</p>
<p>Suppose now <span class="math notranslate nohighlight">\(M\)</span> is an <span class="math notranslate nohighlight">\(A\)</span>-module. <span class="math notranslate nohighlight">\(M\)</span> is called <em>finitely generated</em> if there
exists a surjective homomorphism <span class="math notranslate nohighlight">\(A^n \to M\)</span> for some <span class="math notranslate nohighlight">\(n\)</span>. If such a morphism
<span class="math notranslate nohighlight">\(f\)</span> is chosen, the images of the standard basis of <span class="math notranslate nohighlight">\(A^n\)</span> are called the
<em>generators</em> of <span class="math notranslate nohighlight">\(M\)</span>. The module <span class="math notranslate nohighlight">\(ker(f)\)</span> is called <em>syzygy module</em> with respect
to the generators. A module is called <em>finitely presented</em> if it is finitely
generated with a finitely generated syzygy module. The class of finitely
presented modules is essentially the largest class we can hope to be able to
meaningfully compute in.</p>
<p>It is an important theorem that, for all the rings we are considering,
all submodules of finitely generated modules are finitely generated, and hence
finitely generated and finitely presented modules are the same.</p>
<p>The notion of syzygies, while it may first seem rather abstract, is actually
very computational. This is because there exist (fairly easy) algorithms for
computing them, and more general questions (kernels, intersections, …) are
often reduced to syzygy computation.</p>
<p>Let us say a few words about the definition of homomorphisms in the AGCA
module. Suppose first that <span class="math notranslate nohighlight">\(f : M \to N\)</span> is an arbitrary morphism of
<span class="math notranslate nohighlight">\(A\)</span>-modules. Then if <span class="math notranslate nohighlight">\(K\)</span> is a submodule of <span class="math notranslate nohighlight">\(M\)</span>, <span class="math notranslate nohighlight">\(f\)</span> naturally defines a new
homomorphism <span class="math notranslate nohighlight">\(g: K \to N\)</span> (via <span class="math notranslate nohighlight">\(g(x) = f(x)\)</span>), called the <em>restriction</em> of
<span class="math notranslate nohighlight">\(f\)</span> to <span class="math notranslate nohighlight">\(K\)</span>. If now <span class="math notranslate nohighlight">\(K\)</span> contained in the kernel of
<span class="math notranslate nohighlight">\(f\)</span>, then moreover <span class="math notranslate nohighlight">\(f\)</span> defines in a natural homomorphism <span class="math notranslate nohighlight">\(g: M/K \to N\)</span>
(same formula as above!), and we say that <span class="math notranslate nohighlight">\(f\)</span> <em>descends</em> to <span class="math notranslate nohighlight">\(M/K\)</span>.
Similarly, if <span class="math notranslate nohighlight">\(L\)</span> is a submodule of <span class="math notranslate nohighlight">\(N\)</span>, there is a natural homomorphism
<span class="math notranslate nohighlight">\(g: M \to N/L\)</span>, we say that <span class="math notranslate nohighlight">\(g\)</span> <em>factors</em> through <span class="math notranslate nohighlight">\(f\)</span>. Finally, if now <span class="math notranslate nohighlight">\(L\)</span>
contains the image of <span class="math notranslate nohighlight">\(f\)</span>, then there is a natural homomorphism <span class="math notranslate nohighlight">\(g: M \to L\)</span>
(defined, again, by the same formula), and we say <span class="math notranslate nohighlight">\(g\)</span> is obtained from <span class="math notranslate nohighlight">\(f\)</span>
by restriction of codomain. Observe also that each of these four operations
is reversible, in the sense that given <span class="math notranslate nohighlight">\(g\)</span>, one can always (non-uniquely)
find <span class="math notranslate nohighlight">\(f\)</span> such that <span class="math notranslate nohighlight">\(g\)</span> is obtained from <span class="math notranslate nohighlight">\(f\)</span> in the above way.</p>
<p>Note that all modules implemented in AGCA are obtained from free modules by
taking a succession of submodules and quotients. Hence, in order to explain
how to define a homomorphism between arbitrary modules, in light of the above,
we need only explain how to define homomorphisms of free modules. But,
essentially by the definition of free module, a homomorphism from a free module
<span class="math notranslate nohighlight">\(A^n\)</span> to any module <span class="math notranslate nohighlight">\(M\)</span> is precisely the same as giving <span class="math notranslate nohighlight">\(n\)</span> elements of <span class="math notranslate nohighlight">\(M\)</span>
(the images of the standard basis), and giving an element of a free module
<span class="math notranslate nohighlight">\(A^m\)</span> is precisely the same as giving <span class="math notranslate nohighlight">\(m\)</span> elements of <span class="math notranslate nohighlight">\(A\)</span>. Hence a
homomorphism of free modules <span class="math notranslate nohighlight">\(A^n \to A^m\)</span> can be specified via a matrix,
entirely analogously to the case of vector spaces.</p>
<p>The functions <code class="docutils literal notranslate"><span class="pre">restrict_domain</span></code> etc. of the class <code class="docutils literal notranslate"><span class="pre">Homomorphism</span></code> can be
used
to carry out the operations described above, and homomorphisms of free modules
can in principle be instantiated by hand. Since these operations are so common,
there is a convenience function <code class="docutils literal notranslate"><span class="pre">homomorphism</span></code> to define a homomorphism
between arbitrary modules via the method outlined above. It is essentially
the only way homomorphisms need ever be created by the user.</p>
<dl class="py function">
<dt class="sig sig-object py" id="sympy.polys.agca.homomorphisms.homomorphism">
<span class="sig-prename descclassname"><span class="pre">sympy.polys.agca.homomorphisms.</span></span><span class="sig-name descname"><span class="pre">homomorphism</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">domain</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">codomain</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">matrix</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/homomorphisms.py#L608-L691"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.homomorphisms.homomorphism" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a homomorphism object.</p>
<p>This function tries to build a homomorphism from <code class="docutils literal notranslate"><span class="pre">domain</span></code> to <code class="docutils literal notranslate"><span class="pre">codomain</span></code>
via the matrix <code class="docutils literal notranslate"><span class="pre">matrix</span></code>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.agca</span> <span class="kn">import</span> <span class="n">homomorphism</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">R</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">T</span> <span class="o">=</span> <span class="n">R</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
</pre></div>
</div>
<p>If <code class="docutils literal notranslate"><span class="pre">domain</span></code> is a free module generated by <span class="math notranslate nohighlight">\(e_1, \ldots, e_n\)</span>, then
<code class="docutils literal notranslate"><span class="pre">matrix</span></code> should be an n-element iterable <span class="math notranslate nohighlight">\((b_1, \ldots, b_n)\)</span> where
the <span class="math notranslate nohighlight">\(b_i\)</span> are elements of <code class="docutils literal notranslate"><span class="pre">codomain</span></code>. The constructed homomorphism is the
unique homomorphism sending <span class="math notranslate nohighlight">\(e_i\)</span> to <span class="math notranslate nohighlight">\(b_i\)</span>.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">F</span> <span class="o">=</span> <span class="n">R</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">h</span> <span class="o">=</span> <span class="n">homomorphism</span><span class="p">(</span><span class="n">F</span><span class="p">,</span> <span class="n">T</span><span class="p">,</span> <span class="p">[[</span><span class="mi">1</span><span class="p">,</span> <span class="n">x</span><span class="p">],</span> <span class="p">[</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="mi">0</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">h</span>
<span class="go">Matrix([</span>
<span class="go">[1, x**2], : QQ[x]**2 -&gt; QQ[x]**2</span>
<span class="go">[x,    0]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">h</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">])</span>
<span class="go">[1, x]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">h</span><span class="p">([</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">])</span>
<span class="go">[x**2, 0]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">h</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">])</span>
<span class="go">[x**2 + 1, x]</span>
</pre></div>
</div>
<p>If <code class="docutils literal notranslate"><span class="pre">domain</span></code> is a submodule of a free module, them <code class="docutils literal notranslate"><span class="pre">matrix</span></code> determines
a homomoprhism from the containing free module to <code class="docutils literal notranslate"><span class="pre">codomain</span></code>, and the
homomorphism returned is obtained by restriction to <code class="docutils literal notranslate"><span class="pre">domain</span></code>.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">S</span> <span class="o">=</span> <span class="n">F</span><span class="o">.</span><span class="n">submodule</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">],</span> <span class="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="n">x</span><span class="p">])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">homomorphism</span><span class="p">(</span><span class="n">S</span><span class="p">,</span> <span class="n">T</span><span class="p">,</span> <span class="p">[[</span><span class="mi">1</span><span class="p">,</span> <span class="n">x</span><span class="p">],</span> <span class="p">[</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="mi">0</span><span class="p">]])</span>
<span class="go">Matrix([</span>
<span class="go">[1, x**2], : &lt;[1, 0], [0, x]&gt; -&gt; QQ[x]**2</span>
<span class="go">[x,    0]])</span>
</pre></div>
</div>
<p>If <code class="docutils literal notranslate"><span class="pre">domain</span></code> is a (sub)quotient <span class="math notranslate nohighlight">\(N/K\)</span>, then <code class="docutils literal notranslate"><span class="pre">matrix</span></code> determines a
homomorphism from <span class="math notranslate nohighlight">\(N\)</span> to <code class="docutils literal notranslate"><span class="pre">codomain</span></code>. If the kernel contains <span class="math notranslate nohighlight">\(K\)</span>, this
homomorphism descends to <code class="docutils literal notranslate"><span class="pre">domain</span></code> and is returned; otherwise an exception
is raised.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">homomorphism</span><span class="p">(</span><span class="n">S</span><span class="o">/</span><span class="p">[(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">)],</span> <span class="n">T</span><span class="p">,</span> <span class="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="p">[</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="mi">0</span><span class="p">]])</span>
<span class="go">Matrix([</span>
<span class="go">[0, x**2], : &lt;[1, 0] + &lt;[1, 0]&gt;, [0, x] + &lt;[1, 0]&gt;, [1, 0] + &lt;[1, 0]&gt;&gt; -&gt; QQ[x]**2</span>
<span class="go">[0,    0]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">homomorphism</span><span class="p">(</span><span class="n">S</span><span class="o">/</span><span class="p">[(</span><span class="mi">0</span><span class="p">,</span> <span class="n">x</span><span class="p">)],</span> <span class="n">T</span><span class="p">,</span> <span class="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="p">[</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="mi">0</span><span class="p">]])</span>
<span class="gt">Traceback (most recent call last):</span>
<span class="c">...</span>
<span class="gr">ValueError</span>: <span class="n">kernel &lt;[1, 0], [0, 0]&gt; must contain sm, got &lt;[0,x]&gt;</span>
</pre></div>
</div>
</dd></dl>

<p>Finally, here is the detailed reference of the actual homomorphism class:</p>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.agca.homomorphisms.ModuleHomomorphism">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.agca.homomorphisms.</span></span><span class="sig-name descname"><span class="pre">ModuleHomomorphism</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">domain</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">codomain</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/homomorphisms.py#L18-L441"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.homomorphisms.ModuleHomomorphism" title="Permalink to this definition">¶</a></dt>
<dd><p>Abstract base class for module homomoprhisms. Do not instantiate.</p>
<p>Instead, use the <code class="docutils literal notranslate"><span class="pre">homomorphism</span></code> function:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.agca</span> <span class="kn">import</span> <span class="n">homomorphism</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">F</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">homomorphism</span><span class="p">(</span><span class="n">F</span><span class="p">,</span> <span class="n">F</span><span class="p">,</span> <span class="p">[[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">],</span> <span class="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">]])</span>
<span class="go">Matrix([</span>
<span class="go">[1, 0], : QQ[x]**2 -&gt; QQ[x]**2</span>
<span class="go">[0, 1]])</span>
</pre></div>
</div>
<p>Attributes:</p>
<ul class="simple">
<li><p>ring - the ring over which we are considering modules</p></li>
<li><p>domain - the domain module</p></li>
<li><p>codomain - the codomain module</p></li>
<li><p>_ker - cached kernel</p></li>
<li><p>_img - cached image</p></li>
</ul>
<p>Non-implemented methods:</p>
<ul class="simple">
<li><p>_kernel</p></li>
<li><p>_image</p></li>
<li><p>_restrict_domain</p></li>
<li><p>_restrict_codomain</p></li>
<li><p>_quotient_domain</p></li>
<li><p>_quotient_codomain</p></li>
<li><p>_apply</p></li>
<li><p>_mul_scalar</p></li>
<li><p>_compose</p></li>
<li><p>_add</p></li>
</ul>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.homomorphisms.ModuleHomomorphism.image">
<span class="sig-name descname"><span class="pre">image</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/homomorphisms.py#L92-L112"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.homomorphisms.ModuleHomomorphism.image" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the image of <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
<p>That is, if <code class="docutils literal notranslate"><span class="pre">self</span></code> is the homomorphism <span class="math notranslate nohighlight">\(\phi: M \to N\)</span>, then compute
<span class="math notranslate nohighlight">\(im(\phi) = \{\phi(x) | x \in M \}\)</span>.  This is a submodule of <span class="math notranslate nohighlight">\(N\)</span>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.agca</span> <span class="kn">import</span> <span class="n">homomorphism</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">F</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">homomorphism</span><span class="p">(</span><span class="n">F</span><span class="p">,</span> <span class="n">F</span><span class="p">,</span> <span class="p">[[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">],</span> <span class="p">[</span><span class="n">x</span><span class="p">,</span> <span class="mi">0</span><span class="p">]])</span><span class="o">.</span><span class="n">image</span><span class="p">()</span> <span class="o">==</span> <span class="n">F</span><span class="o">.</span><span class="n">submodule</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">])</span>
<span class="go">True</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.homomorphisms.ModuleHomomorphism.is_injective">
<span class="sig-name descname"><span class="pre">is_injective</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/homomorphisms.py#L339-L360"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.homomorphisms.ModuleHomomorphism.is_injective" title="Permalink to this definition">¶</a></dt>
<dd><p>Return True if <code class="docutils literal notranslate"><span class="pre">self</span></code> is injective.</p>
<p>That is, check if the elements of the domain are mapped to the same
codomain element.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.agca</span> <span class="kn">import</span> <span class="n">homomorphism</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">F</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">h</span> <span class="o">=</span> <span class="n">homomorphism</span><span class="p">(</span><span class="n">F</span><span class="p">,</span> <span class="n">F</span><span class="p">,</span> <span class="p">[[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">],</span> <span class="p">[</span><span class="n">x</span><span class="p">,</span> <span class="mi">0</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">h</span><span class="o">.</span><span class="n">is_injective</span><span class="p">()</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">h</span><span class="o">.</span><span class="n">quotient_domain</span><span class="p">(</span><span class="n">h</span><span class="o">.</span><span class="n">kernel</span><span class="p">())</span><span class="o">.</span><span class="n">is_injective</span><span class="p">()</span>
<span class="go">True</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.homomorphisms.ModuleHomomorphism.is_isomorphism">
<span class="sig-name descname"><span class="pre">is_isomorphism</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/homomorphisms.py#L385-L407"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.homomorphisms.ModuleHomomorphism.is_isomorphism" title="Permalink to this definition">¶</a></dt>
<dd><p>Return True if <code class="docutils literal notranslate"><span class="pre">self</span></code> is an isomorphism.</p>
<p>That is, check if every element of the codomain has precisely one
preimage. Equivalently, <code class="docutils literal notranslate"><span class="pre">self</span></code> is both injective and surjective.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.agca</span> <span class="kn">import</span> <span class="n">homomorphism</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">F</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">h</span> <span class="o">=</span> <span class="n">homomorphism</span><span class="p">(</span><span class="n">F</span><span class="p">,</span> <span class="n">F</span><span class="p">,</span> <span class="p">[[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">],</span> <span class="p">[</span><span class="n">x</span><span class="p">,</span> <span class="mi">0</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">h</span> <span class="o">=</span> <span class="n">h</span><span class="o">.</span><span class="n">restrict_codomain</span><span class="p">(</span><span class="n">h</span><span class="o">.</span><span class="n">image</span><span class="p">())</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">h</span><span class="o">.</span><span class="n">is_isomorphism</span><span class="p">()</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">h</span><span class="o">.</span><span class="n">quotient_domain</span><span class="p">(</span><span class="n">h</span><span class="o">.</span><span class="n">kernel</span><span class="p">())</span><span class="o">.</span><span class="n">is_isomorphism</span><span class="p">()</span>
<span class="go">True</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.homomorphisms.ModuleHomomorphism.is_surjective">
<span class="sig-name descname"><span class="pre">is_surjective</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/homomorphisms.py#L362-L383"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.homomorphisms.ModuleHomomorphism.is_surjective" title="Permalink to this definition">¶</a></dt>
<dd><p>Return True if <code class="docutils literal notranslate"><span class="pre">self</span></code> is surjective.</p>
<p>That is, check if every element of the codomain has at least one
preimage.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.agca</span> <span class="kn">import</span> <span class="n">homomorphism</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">F</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">h</span> <span class="o">=</span> <span class="n">homomorphism</span><span class="p">(</span><span class="n">F</span><span class="p">,</span> <span class="n">F</span><span class="p">,</span> <span class="p">[[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">],</span> <span class="p">[</span><span class="n">x</span><span class="p">,</span> <span class="mi">0</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">h</span><span class="o">.</span><span class="n">is_surjective</span><span class="p">()</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">h</span><span class="o">.</span><span class="n">restrict_codomain</span><span class="p">(</span><span class="n">h</span><span class="o">.</span><span class="n">image</span><span class="p">())</span><span class="o">.</span><span class="n">is_surjective</span><span class="p">()</span>
<span class="go">True</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.homomorphisms.ModuleHomomorphism.is_zero">
<span class="sig-name descname"><span class="pre">is_zero</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/homomorphisms.py#L409-L432"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.homomorphisms.ModuleHomomorphism.is_zero" title="Permalink to this definition">¶</a></dt>
<dd><p>Return True if <code class="docutils literal notranslate"><span class="pre">self</span></code> is a zero morphism.</p>
<p>That is, check if every element of the domain is mapped to zero
under self.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.agca</span> <span class="kn">import</span> <span class="n">homomorphism</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">F</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">h</span> <span class="o">=</span> <span class="n">homomorphism</span><span class="p">(</span><span class="n">F</span><span class="p">,</span> <span class="n">F</span><span class="p">,</span> <span class="p">[[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">],</span> <span class="p">[</span><span class="n">x</span><span class="p">,</span> <span class="mi">0</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">h</span><span class="o">.</span><span class="n">is_zero</span><span class="p">()</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">h</span><span class="o">.</span><span class="n">restrict_domain</span><span class="p">(</span><span class="n">F</span><span class="o">.</span><span class="n">submodule</span><span class="p">())</span><span class="o">.</span><span class="n">is_zero</span><span class="p">()</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">h</span><span class="o">.</span><span class="n">quotient_codomain</span><span class="p">(</span><span class="n">h</span><span class="o">.</span><span class="n">image</span><span class="p">())</span><span class="o">.</span><span class="n">is_zero</span><span class="p">()</span>
<span class="go">True</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.homomorphisms.ModuleHomomorphism.kernel">
<span class="sig-name descname"><span class="pre">kernel</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/homomorphisms.py#L70-L90"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.homomorphisms.ModuleHomomorphism.kernel" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the kernel of <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
<p>That is, if <code class="docutils literal notranslate"><span class="pre">self</span></code> is the homomorphism <span class="math notranslate nohighlight">\(\phi: M \to N\)</span>, then compute
<span class="math notranslate nohighlight">\(ker(\phi) = \{x \in M | \phi(x) = 0\}\)</span>.  This is a submodule of <span class="math notranslate nohighlight">\(M\)</span>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.agca</span> <span class="kn">import</span> <span class="n">homomorphism</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">F</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">homomorphism</span><span class="p">(</span><span class="n">F</span><span class="p">,</span> <span class="n">F</span><span class="p">,</span> <span class="p">[[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">],</span> <span class="p">[</span><span class="n">x</span><span class="p">,</span> <span class="mi">0</span><span class="p">]])</span><span class="o">.</span><span class="n">kernel</span><span class="p">()</span>
<span class="go">&lt;[x, -1]&gt;</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.homomorphisms.ModuleHomomorphism.quotient_codomain">
<span class="sig-name descname"><span class="pre">quotient_codomain</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">sm</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/homomorphisms.py#L240-L276"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.homomorphisms.ModuleHomomorphism.quotient_codomain" title="Permalink to this definition">¶</a></dt>
<dd><p>Return <code class="docutils literal notranslate"><span class="pre">self</span></code> with codomain replaced by <code class="docutils literal notranslate"><span class="pre">codomain/sm</span></code>.</p>
<p>Here <code class="docutils literal notranslate"><span class="pre">sm</span></code> must be a submodule of <code class="docutils literal notranslate"><span class="pre">self.codomain</span></code>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.agca</span> <span class="kn">import</span> <span class="n">homomorphism</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">F</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">h</span> <span class="o">=</span> <span class="n">homomorphism</span><span class="p">(</span><span class="n">F</span><span class="p">,</span> <span class="n">F</span><span class="p">,</span> <span class="p">[[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">],</span> <span class="p">[</span><span class="n">x</span><span class="p">,</span> <span class="mi">0</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">h</span>
<span class="go">Matrix([</span>
<span class="go">[1, x], : QQ[x]**2 -&gt; QQ[x]**2</span>
<span class="go">[0, 0]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">h</span><span class="o">.</span><span class="n">quotient_codomain</span><span class="p">(</span><span class="n">F</span><span class="o">.</span><span class="n">submodule</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">]))</span>
<span class="go">Matrix([</span>
<span class="go">[1, x], : QQ[x]**2 -&gt; QQ[x]**2/&lt;[1, 1]&gt;</span>
<span class="go">[0, 0]])</span>
</pre></div>
</div>
<p>This is the same as composing with the quotient map on the left:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="p">(</span><span class="n">F</span><span class="o">/</span><span class="p">[(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">)])</span><span class="o">.</span><span class="n">quotient_hom</span><span class="p">()</span> <span class="o">*</span> <span class="n">h</span>
<span class="go">Matrix([</span>
<span class="go">[1, x], : QQ[x]**2 -&gt; QQ[x]**2/&lt;[1, 1]&gt;</span>
<span class="go">[0, 0]])</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.homomorphisms.ModuleHomomorphism.quotient_domain">
<span class="sig-name descname"><span class="pre">quotient_domain</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">sm</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/homomorphisms.py#L209-L238"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.homomorphisms.ModuleHomomorphism.quotient_domain" title="Permalink to this definition">¶</a></dt>
<dd><p>Return <code class="docutils literal notranslate"><span class="pre">self</span></code> with domain replaced by <code class="docutils literal notranslate"><span class="pre">domain/sm</span></code>.</p>
<p>Here <code class="docutils literal notranslate"><span class="pre">sm</span></code> must be a submodule of <code class="docutils literal notranslate"><span class="pre">self.kernel()</span></code>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.agca</span> <span class="kn">import</span> <span class="n">homomorphism</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">F</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">h</span> <span class="o">=</span> <span class="n">homomorphism</span><span class="p">(</span><span class="n">F</span><span class="p">,</span> <span class="n">F</span><span class="p">,</span> <span class="p">[[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">],</span> <span class="p">[</span><span class="n">x</span><span class="p">,</span> <span class="mi">0</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">h</span>
<span class="go">Matrix([</span>
<span class="go">[1, x], : QQ[x]**2 -&gt; QQ[x]**2</span>
<span class="go">[0, 0]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">h</span><span class="o">.</span><span class="n">quotient_domain</span><span class="p">(</span><span class="n">F</span><span class="o">.</span><span class="n">submodule</span><span class="p">([</span><span class="o">-</span><span class="n">x</span><span class="p">,</span> <span class="mi">1</span><span class="p">]))</span>
<span class="go">Matrix([</span>
<span class="go">[1, x], : QQ[x]**2/&lt;[-x, 1]&gt; -&gt; QQ[x]**2</span>
<span class="go">[0, 0]])</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.homomorphisms.ModuleHomomorphism.restrict_codomain">
<span class="sig-name descname"><span class="pre">restrict_codomain</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">sm</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/homomorphisms.py#L177-L207"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.homomorphisms.ModuleHomomorphism.restrict_codomain" title="Permalink to this definition">¶</a></dt>
<dd><p>Return <code class="docutils literal notranslate"><span class="pre">self</span></code>, with codomain restricted to to <code class="docutils literal notranslate"><span class="pre">sm</span></code>.</p>
<p>Here <code class="docutils literal notranslate"><span class="pre">sm</span></code> has to be a submodule of <code class="docutils literal notranslate"><span class="pre">self.codomain</span></code> containing the
image.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.agca</span> <span class="kn">import</span> <span class="n">homomorphism</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">F</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">h</span> <span class="o">=</span> <span class="n">homomorphism</span><span class="p">(</span><span class="n">F</span><span class="p">,</span> <span class="n">F</span><span class="p">,</span> <span class="p">[[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">],</span> <span class="p">[</span><span class="n">x</span><span class="p">,</span> <span class="mi">0</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">h</span>
<span class="go">Matrix([</span>
<span class="go">[1, x], : QQ[x]**2 -&gt; QQ[x]**2</span>
<span class="go">[0, 0]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">h</span><span class="o">.</span><span class="n">restrict_codomain</span><span class="p">(</span><span class="n">F</span><span class="o">.</span><span class="n">submodule</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">]))</span>
<span class="go">Matrix([</span>
<span class="go">[1, x], : QQ[x]**2 -&gt; &lt;[1, 0]&gt;</span>
<span class="go">[0, 0]])</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.homomorphisms.ModuleHomomorphism.restrict_domain">
<span class="sig-name descname"><span class="pre">restrict_domain</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">sm</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/homomorphisms.py#L138-L175"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.homomorphisms.ModuleHomomorphism.restrict_domain" title="Permalink to this definition">¶</a></dt>
<dd><p>Return <code class="docutils literal notranslate"><span class="pre">self</span></code>, with the domain restricted to <code class="docutils literal notranslate"><span class="pre">sm</span></code>.</p>
<p>Here <code class="docutils literal notranslate"><span class="pre">sm</span></code> has to be a submodule of <code class="docutils literal notranslate"><span class="pre">self.domain</span></code>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">QQ</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.agca</span> <span class="kn">import</span> <span class="n">homomorphism</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">F</span> <span class="o">=</span> <span class="n">QQ</span><span class="o">.</span><span class="n">old_poly_ring</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">free_module</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">h</span> <span class="o">=</span> <span class="n">homomorphism</span><span class="p">(</span><span class="n">F</span><span class="p">,</span> <span class="n">F</span><span class="p">,</span> <span class="p">[[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">],</span> <span class="p">[</span><span class="n">x</span><span class="p">,</span> <span class="mi">0</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">h</span>
<span class="go">Matrix([</span>
<span class="go">[1, x], : QQ[x]**2 -&gt; QQ[x]**2</span>
<span class="go">[0, 0]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">h</span><span class="o">.</span><span class="n">restrict_domain</span><span class="p">(</span><span class="n">F</span><span class="o">.</span><span class="n">submodule</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">]))</span>
<span class="go">Matrix([</span>
<span class="go">[1, x], : &lt;[1, 0]&gt; -&gt; QQ[x]**2</span>
<span class="go">[0, 0]])</span>
</pre></div>
</div>
<p>This is the same as just composing on the right with the submodule
inclusion:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">h</span> <span class="o">*</span> <span class="n">F</span><span class="o">.</span><span class="n">submodule</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">])</span><span class="o">.</span><span class="n">inclusion_hom</span><span class="p">()</span>
<span class="go">Matrix([</span>
<span class="go">[1, x], : &lt;[1, 0]&gt; -&gt; QQ[x]**2</span>
<span class="go">[0, 0]])</span>
</pre></div>
</div>
</dd></dl>

</dd></dl>

</section>
<section id="finite-extensions">
<h3>Finite Extensions<a class="headerlink" href="#finite-extensions" title="Permalink to this headline">¶</a></h3>
<p>Let <span class="math notranslate nohighlight">\(A\)</span> be a (commutative) ring and <span class="math notranslate nohighlight">\(B\)</span> an extension ring of <span class="math notranslate nohighlight">\(A\)</span>.
An element <span class="math notranslate nohighlight">\(t\)</span> of <span class="math notranslate nohighlight">\(B\)</span> is a generator of <span class="math notranslate nohighlight">\(B\)</span> (over <span class="math notranslate nohighlight">\(A\)</span>) if all elements
of <span class="math notranslate nohighlight">\(B\)</span> can be represented as polynomials in <span class="math notranslate nohighlight">\(t\)</span> with coefficients
in <span class="math notranslate nohighlight">\(A\)</span>. The representation is unique if and only if <span class="math notranslate nohighlight">\(t\)</span> satisfies no
non-trivial polynomial relation, in which case <span class="math notranslate nohighlight">\(B\)</span> can be identified
with a (univariate) polynomial ring over <span class="math notranslate nohighlight">\(A\)</span>.</p>
<p>The polynomials having <span class="math notranslate nohighlight">\(t\)</span> as a root form a non-zero ideal in general.
The most important case in practice is that of an ideal generated by
a single monic polynomial. If <span class="math notranslate nohighlight">\(t\)</span> satisfies such a polynomial relation,
then its highest power <span class="math notranslate nohighlight">\(t^n\)</span> can be written as linear combination of
lower powers. It follows, inductively, that all higher powers of <span class="math notranslate nohighlight">\(t\)</span>
also have such a representation. Hence the lower powers <span class="math notranslate nohighlight">\(t^i\)</span>
(<span class="math notranslate nohighlight">\(i = 0, \dots, n-1\)</span>) form a basis of <span class="math notranslate nohighlight">\(B\)</span>, which is then called a finite
extension of <span class="math notranslate nohighlight">\(A\)</span>, or, more precisely, a monogenic finite extension
as it is generated by a single element <span class="math notranslate nohighlight">\(t\)</span>.</p>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.agca.extensions.MonogenicFiniteExtension">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.agca.extensions.</span></span><span class="sig-name descname"><span class="pre">MonogenicFiniteExtension</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">mod</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/extensions.py#L216-L344"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.extensions.MonogenicFiniteExtension" title="Permalink to this definition">¶</a></dt>
<dd><p>Finite extension generated by an integral element.</p>
<p>The generator is defined by a monic univariate
polynomial derived from the argument <code class="docutils literal notranslate"><span class="pre">mod</span></code>.</p>
<p>A shorter alias is <code class="docutils literal notranslate"><span class="pre">FiniteExtension</span></code>.</p>
<p class="rubric">Examples</p>
<p>Quadratic integer ring <span class="math notranslate nohighlight">\(\mathbb{Z}[\sqrt2]\)</span>:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Symbol</span><span class="p">,</span> <span class="n">Poly</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.polys.agca.extensions</span> <span class="kn">import</span> <span class="n">FiniteExtension</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;x&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">R</span> <span class="o">=</span> <span class="n">FiniteExtension</span><span class="p">(</span><span class="n">Poly</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="mi">2</span><span class="p">));</span> <span class="n">R</span>
<span class="go">ZZ[x]/(x**2 - 2)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">R</span><span class="o">.</span><span class="n">rank</span>
<span class="go">2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">R</span><span class="p">(</span><span class="mi">1</span> <span class="o">+</span> <span class="n">x</span><span class="p">)</span><span class="o">*</span><span class="p">(</span><span class="mi">3</span> <span class="o">-</span> <span class="mi">2</span><span class="o">*</span><span class="n">x</span><span class="p">)</span>
<span class="go">x - 1</span>
</pre></div>
</div>
<p>Finite field <span class="math notranslate nohighlight">\(GF(5^3)\)</span> defined by the primitive
polynomial <span class="math notranslate nohighlight">\(x^3 + x^2 + 2\)</span> (over <span class="math notranslate nohighlight">\(\mathbb{Z}_5\)</span>).</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">F</span> <span class="o">=</span> <span class="n">FiniteExtension</span><span class="p">(</span><span class="n">Poly</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">3</span> <span class="o">+</span> <span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">2</span><span class="p">,</span> <span class="n">modulus</span><span class="o">=</span><span class="mi">5</span><span class="p">));</span> <span class="n">F</span>
<span class="go">GF(5)[x]/(x**3 + x**2 + 2)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F</span><span class="o">.</span><span class="n">basis</span>
<span class="go">(1, x, x**2)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F</span><span class="p">(</span><span class="n">x</span> <span class="o">+</span> <span class="mi">3</span><span class="p">)</span><span class="o">/</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">2</span><span class="p">)</span>
<span class="go">-2*x**2 + x + 2</span>
</pre></div>
</div>
<p>Function field of an elliptic curve:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">t</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;t&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">FiniteExtension</span><span class="p">(</span><span class="n">Poly</span><span class="p">(</span><span class="n">t</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="n">x</span><span class="o">**</span><span class="mi">3</span> <span class="o">-</span> <span class="n">x</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">t</span><span class="p">,</span> <span class="n">field</span><span class="o">=</span><span class="kc">True</span><span class="p">))</span>
<span class="go">ZZ(x)[t]/(t**2 - x**3 - x + 1)</span>
</pre></div>
</div>
<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.polys.agca.extensions.MonogenicFiniteExtension.dtype">
<span class="sig-name descname"><span class="pre">dtype</span></span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/extensions.py#L11-L211"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.extensions.MonogenicFiniteExtension.dtype" title="Permalink to this definition">¶</a></dt>
<dd><p>alias of <a class="reference internal" href="#sympy.polys.agca.extensions.ExtensionElement" title="sympy.polys.agca.extensions.ExtensionElement"><code class="xref py py-class docutils literal notranslate"><span class="pre">sympy.polys.agca.extensions.ExtensionElement</span></code></a></p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.polys.agca.extensions.ExtensionElement">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.polys.agca.extensions.</span></span><span class="sig-name descname"><span class="pre">ExtensionElement</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">rep</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ext</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/extensions.py#L11-L211"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.extensions.ExtensionElement" title="Permalink to this definition">¶</a></dt>
<dd><p>Element of a finite extension.</p>
<p>A class of univariate polynomials modulo the <code class="docutils literal notranslate"><span class="pre">modulus</span></code>
of the extension <code class="docutils literal notranslate"><span class="pre">ext</span></code>. It is represented by the
unique polynomial <code class="docutils literal notranslate"><span class="pre">rep</span></code> of lowest degree. Both
<code class="docutils literal notranslate"><span class="pre">rep</span></code> and the representation <code class="docutils literal notranslate"><span class="pre">mod</span></code> of <code class="docutils literal notranslate"><span class="pre">modulus</span></code>
are of class DMP.</p>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.polys.agca.extensions.ExtensionElement.inverse">
<span class="sig-name descname"><span class="pre">inverse</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/polys/agca/extensions.py#L102-L120"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.polys.agca.extensions.ExtensionElement.inverse" title="Permalink to this definition">¶</a></dt>
<dd><p>Multiplicative inverse.</p>
<dl class="field-list">
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p><strong>NotInvertible</strong></p>
<blockquote>
<div><p>If the element is a zero divisor.</p>
</div></blockquote>
</dd>
</dl>
</dd></dl>

</dd></dl>

</section>
</section>
</section>


            <div class="clearer"></div>
          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="../../index.html">
              <img class="logo" src="../../_static/sympylogo.png" alt="Logo"/>
            </a></p>
  <h3><a href="../../index.html">Table of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">AGCA - Algebraic Geometry and Commutative Algebra Module</a><ul>
<li><a class="reference internal" href="#introduction">Introduction</a></li>
<li><a class="reference internal" href="#reference">Reference</a><ul>
<li><a class="reference internal" href="#base-rings">Base Rings</a></li>
<li><a class="reference internal" href="#modules-ideals-and-their-elementary-properties">Modules, Ideals and their Elementary Properties</a></li>
<li><a class="reference internal" href="#module-homomorphisms-and-syzygies">Module Homomorphisms and Syzygies</a></li>
<li><a class="reference internal" href="#finite-extensions">Finite Extensions</a></li>
</ul>
</li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="reference.html"
                        title="previous chapter">Polynomials Manipulation Module Reference</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="domainsintro.html"
                        title="next chapter">Introducing the Domains of the poly module</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../../_sources/modules/polys/agca.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="https://docs.sympy.org/latest/search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>
    </div>
</div>
<script>$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="domainsintro.html" title="Introducing the Domains of the poly module"
             >next</a> |</li>
        <li class="right" >
          <a href="reference.html" title="Polynomials Manipulation Module Reference"
             >previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../../index.html">SymPy 1.9 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../index.html" >SymPy Modules Reference</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="index.html" >Polynomial Manipulation</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="#">AGCA - Algebraic Geometry and Commutative Algebra Module</a></li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright 2021 SymPy Development Team.
      Last updated on Sep 30, 2021.
      Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.1.2.
    </div>
  </body>

<!-- Mirrored from docs.sympy.org/latest/modules/polys/agca.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 15 Jan 2022 03:29:00 GMT -->
</html>